تدفق التوتر:: العمليات:: TemporaryVariable
#include <state_ops.h>
إرجاع موتر قد يكون متحورًا، ولكنه يستمر فقط خلال خطوة واحدة.
ملخص
هذه عملية تجريبية للاستخدام الداخلي فقط ومن الممكن استخدامها بطرق غير آمنة. لا تستخدمه إلا إذا كنت تفهم المخاطر تمامًا.
تقع على عاتق المتصل مسؤولية التأكد من تمرير "ref" في النهاية إلى عملية " DestroyTemporaryVariable " المطابقة بعد اكتمال جميع الاستخدامات الأخرى.
يُخرج مرجعًا إلى حالة الموتر بحيث يمكن قراءته أو تعديله.
على سبيل المثال، var =state_ops._temporary_variable([1, 2],types.float_) var_name = var.op.name var =state_ops.assi(var, [[4.0, 5.0]]) var =state_ops.sign_add(var, [[ 6.0, 7.0]]) نهائي =state_ops._destroy_temporary_variable(var, var_name=var_name)
الحجج:
- النطاق: كائن النطاق
- الشكل: شكل الموتر المتغير.
- dtype: نوع العناصر في الموتر المتغير.
السمات الاختيارية (انظر Attrs
):
- var_name: يتجاوز الاسم المستخدم للمورد المتغير المؤقت. القيمة الافتراضية هي اسم العملية ' TemporaryVariable ' (والتي تكون فريدة من نوعها).
العوائد:
-
Output
: إشارة إلى الموتر المتغير.
وظائف ثابتة العامة |
---|
VarName (StringPiece x) | |
الصفات العامة
عملية
Operation operation
المرجع
::tensorflow::Output ref
الوظائف العامة
TemporaryVariable
TemporaryVariable(
const ::tensorflow::Scope & scope,
PartialTensorShape shape,
DataType dtype
)
TemporaryVariable
TemporaryVariable(
const ::tensorflow::Scope & scope,
PartialTensorShape shape,
DataType dtype,
const TemporaryVariable::Attrs & attrs
)
العقدة
::tensorflow::Node * node() const
operator::tensorflow::Input() const
المشغل::tensorflow::الإخراج
operator::tensorflow::Output() const
وظائف ثابتة العامة
فارنام
Attrs VarName(
StringPiece x
)
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# tensorflow::ops::TemporaryVariable Class Reference\n\ntensorflow::ops::TemporaryVariable\n==================================\n\n`#include \u003cstate_ops.h\u003e`\n\nReturns a tensor that may be mutated, but only persists within a single step.\n\nSummary\n-------\n\nThis is an experimental op for internal use only and it is possible to use this op in unsafe ways. DO NOT USE unless you fully understand the risks.\n\nIt is the caller's responsibility to ensure that 'ref' is eventually passed to a matching '[DestroyTemporaryVariable](/versions/r2.3/api_docs/cc/class/tensorflow/ops/destroy-temporary-variable#classtensorflow_1_1ops_1_1_destroy_temporary_variable)' op after all other uses have completed.\n\nOutputs a ref to the tensor state so it may be read or modified.\n\nE.g. var = state_ops._temporary_variable(\\[1, 2\\], types.float_) var_name = var.op.name var = state_ops.assign(var, \\[\\[4.0, 5.0\\]\\]) var = state_ops.assign_add(var, \\[\\[6.0, 7.0\\]\\]) final = state_ops._destroy_temporary_variable(var, var_name=var_name)\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- shape: The shape of the variable tensor.\n- dtype: The type of elements in the variable tensor.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/temporary-variable/attrs#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs)):\n\n- var_name: Overrides the name used for the temporary variable resource. Default value is the name of the '[TemporaryVariable](/versions/r2.3/api_docs/cc/class/tensorflow/ops/temporary-variable#classtensorflow_1_1ops_1_1_temporary_variable)' op (which is guaranteed unique).\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A reference to the variable tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [TemporaryVariable](#classtensorflow_1_1ops_1_1_temporary_variable_1a694e6c48eaf39d57f59d52796a9a71d1)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, PartialTensorShape shape, DataType dtype)` ||\n| [TemporaryVariable](#classtensorflow_1_1ops_1_1_temporary_variable_1a43909369fdad702faf95e5aab8346b1a)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, PartialTensorShape shape, DataType dtype, const `[TemporaryVariable::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/temporary-variable/attrs#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_temporary_variable_1abf90e66f914f45a8e9c11f7409917423) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [ref](#classtensorflow_1_1ops_1_1_temporary_variable_1a62601e5fd1b28bd28a6f0db0c691fe61) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_temporary_variable_1a3dbe9a732d4ec4ab4f94240c0ba61210)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_temporary_variable_1a8414b80274ac7ca395a565b59e90cd9e)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_temporary_variable_1a62b24d2f958c91a5a1005127d7056dc9)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| [VarName](#classtensorflow_1_1ops_1_1_temporary_variable_1a6647c19d0e761d2c6c11ff667576cfb5)`(StringPiece x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/temporary-variable/attrs#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::TemporaryVariable::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/temporary-variable/attrs) | Optional attribute setters for [TemporaryVariable](/versions/r2.3/api_docs/cc/class/tensorflow/ops/temporary-variable#classtensorflow_1_1ops_1_1_temporary_variable). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### ref\n\n```text\n::tensorflow::Output ref\n``` \n\nPublic functions\n----------------\n\n### TemporaryVariable\n\n```gdscript\n TemporaryVariable(\n const ::tensorflow::Scope & scope,\n PartialTensorShape shape,\n DataType dtype\n)\n``` \n\n### TemporaryVariable\n\n```gdscript\n TemporaryVariable(\n const ::tensorflow::Scope & scope,\n PartialTensorShape shape,\n DataType dtype,\n const TemporaryVariable::Attrs & attrs\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``` \n\nPublic static functions\n-----------------------\n\n### VarName\n\n```text\nAttrs VarName(\n StringPiece x\n)\n```"]]