جریان تنسور:: عملیات:: اطمینان از شکل
#include <array_ops.h>
اطمینان حاصل می کند که شکل تانسور با شکل مورد انتظار مطابقت دارد.
خلاصه
اگر شکل تانسور ورودی با شکل مشخص شده مطابقت نداشته باشد، خطا ایجاد می کند. در غیر این صورت تانسور ورودی را برمی گرداند.
استدلال ها:
- scope: یک شی Scope
- ورودی: تانسوری که شکل آن باید تایید شود.
- شکل: شکل مورد انتظار (احتمالاً تا حدی مشخص شده) تانسور ورودی.
برمیگرداند:
-
Output
: تانسوری با شکل و محتویات مشابه با تانسور یا مقدار ورودی.
سازندگان و ویرانگرها | |
---|---|
EnsureShape (const :: tensorflow::Scope & scope, :: tensorflow::Input input, PartialTensorShape shape) |
صفات عمومی | |
---|---|
operation | |
output |
توابع عمومی | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
صفات عمومی
عملیات
Operation operation
خروجی
::tensorflow::Output output
توابع عمومی
اطمینان از شکل
EnsureShape( const ::tensorflow::Scope & scope, ::tensorflow::Input input, PartialTensorShape shape )
گره
::tensorflow::Node * node() const
عملگر::tensorflow::ورودی
operator::tensorflow::Input() const
عملگر::tensorflow::خروجی
operator::tensorflow::Output() const
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-26 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-26 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# tensorflow::ops::EnsureShape Class Reference\n\ntensorflow::ops::EnsureShape\n============================\n\n`#include \u003carray_ops.h\u003e`\n\nEnsures that the tensor's shape matches the expected shape.\n\nSummary\n-------\n\nRaises an error if the input tensor's shape does not match the specified shape. Returns the input tensor otherwise.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: A tensor, whose shape is to be validated.\n- shape: The expected (possibly partially specified) shape of the input tensor.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A tensor with the same shape and contents as the input tensor or value.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [EnsureShape](#classtensorflow_1_1ops_1_1_ensure_shape_1a5eccae9b4752e5ce978003d1413e5c06)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, PartialTensorShape shape)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_ensure_shape_1abc933208d9ec4b02b93fd9fbf992457b) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_ensure_shape_1a3de25be53998f6b3c1fe4f88c0b7f90a) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_ensure_shape_1affd7b08d440e2fcd688949c62b747b6d)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ensure_shape_1afd5278e7b8083f310fa151d3e6ca6569)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ensure_shape_1a9ced601bdda49a6b52e0695a81bdee19)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### EnsureShape\n\n```gdscript\n EnsureShape(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n PartialTensorShape shape\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n```"]]