संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: चर
#include <state_ops.h>
राज्य को एक टेंसर के रूप में धारण करता है जो चरणों के पार बना रहता है।
सारांश
टेंसर स्थिति के लिए एक रेफरी आउटपुट करता है ताकि इसे पढ़ा या संशोधित किया जा सके। TODO(zhifengc/mrry): टेंसरफ्लो में राज्यों को साझा करने के बारे में अधिक विस्तृत दस्तावेज़ में एक संकेतक जोड़ता है।
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- आकार: वेरिएबल टेंसर का आकार।
- dtype: वेरिएबल टेंसर में तत्वों का प्रकार।
वैकल्पिक विशेषताएँ (देखें Attrs
):
- कंटेनर: यदि खाली नहीं है, तो यह वेरिएबल दिए गए कंटेनर में रखा गया है। अन्यथा, एक डिफ़ॉल्ट कंटेनर का उपयोग किया जाता है।
- साझा_नाम: यदि खाली नहीं है, तो इस चर को इस साझा_नाम के साथ दिए गए बकेट में नाम दिया गया है। अन्यथा, इसके स्थान पर नोड नाम का उपयोग किया जाता है।
रिटर्न:
-
Output
: वेरिएबल टेंसर का एक संदर्भ।
सार्वजनिक गुण
सार्वजनिक समारोह
चर
Variable(
const ::tensorflow::Scope & scope,
PartialTensorShape shape,
DataType dtype
)
नोड
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ऑपरेटर::टेन्सरफ़्लो::आउटपुट
operator::tensorflow::Output() const
सार्वजनिक स्थैतिक कार्य
पात्र
Attrs Container(
StringPiece x
)
साझानाम
Attrs SharedName(
StringPiece x
)
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::Variable Class Reference\n\ntensorflow::ops::Variable\n=========================\n\n`#include \u003cstate_ops.h\u003e`\n\nHolds state in the form of a tensor that persists across steps.\n\nSummary\n-------\n\nOutputs a ref to the tensor state so it may be read or modified. TODO(zhifengc/mrry): Adds a pointer to a more detail document about sharing states in tensorflow.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/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/r1.15/api_docs/cc/struct/tensorflow/ops/variable/attrs#structtensorflow_1_1ops_1_1_variable_1_1_attrs)):\n\n- container: If non-empty, this variable is placed in the given container. Otherwise, a default container is used.\n- shared_name: If non-empty, this variable is named in the given bucket with this shared_name. Otherwise, the node name is used instead.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/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| [Variable](#classtensorflow_1_1ops_1_1_variable_1af0402912fc9605aef0d837283ca95251)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, PartialTensorShape shape, DataType dtype)` ||\n| [Variable](#classtensorflow_1_1ops_1_1_variable_1a838420f5a738df6e954620d76ead19b3)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, PartialTensorShape shape, DataType dtype, const `[Variable::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/variable/attrs#structtensorflow_1_1ops_1_1_variable_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_variable_1ac6e1c46400dc4348423b98ab9555b44f) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [ref](#classtensorflow_1_1ops_1_1_variable_1a22544a8c4cc8ca5250d9d91eb73563f2) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_variable_1a4ab4f0408562846875bd4b320f1a78f5)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_variable_1a09c4715d4048cfcc9522d1d6e496ddfe)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_variable_1a28b2d6e24ae536d8375af583a380f7bb)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|\n| [Container](#classtensorflow_1_1ops_1_1_variable_1a11918e4a4bb8a9c53eb5d8b3c01b39db)`(StringPiece x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/variable/attrs#structtensorflow_1_1ops_1_1_variable_1_1_attrs) |\n| [SharedName](#classtensorflow_1_1ops_1_1_variable_1a38a30153444617338e1c943515b1483a)`(StringPiece x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/variable/attrs#structtensorflow_1_1ops_1_1_variable_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::Variable::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/variable/attrs) | Optional attribute setters for [Variable](/versions/r1.15/api_docs/cc/class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_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### Variable\n\n```gdscript\n Variable(\n const ::tensorflow::Scope & scope,\n PartialTensorShape shape,\n DataType dtype\n)\n``` \n\n### Variable\n\n```gdscript\n Variable(\n const ::tensorflow::Scope & scope,\n PartialTensorShape shape,\n DataType dtype,\n const Variable::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### Container\n\n```text\nAttrs Container(\n StringPiece x\n)\n``` \n\n### SharedName\n\n```text\nAttrs SharedName(\n StringPiece x\n)\n```"]]