tensorflow:: אופס:: מִשְׁתַנֶה
#include <state_ops.h>
מחזיק במצב בצורה של טנזור שנמשך לאורך שלבים.
תַקצִיר
מוציא רפר למצב הטנזור כך שניתן לקרוא אותו או לשנותו. TODO(zhifengc/mrry): הוספת מצביע למסמך מפורט יותר על שיתוף מצבים בזרימת tensor.
טיעונים:
- scope: אובייקט Scope
- צורה: צורת הטנזור המשתנה.
- dtype: סוג האלמנטים בטנזור המשתנה.
מאפיינים אופציונליים (ראה Attrs
):
- מיכל: אם אינו ריק, משתנה זה ממוקם במיכל הנתון. אחרת, נעשה שימוש במיכל ברירת מחדל.
- shared_name: אם אינו ריק, משתנה זה נקרא בדלי הנתון עם shared_name זה. אחרת, שם הצומת משמש במקום זאת.
החזרות:
-
Output
: התייחסות לטנזור המשתנה.
בנאים והורסים | |
---|---|
Variable (const :: tensorflow::Scope & scope, PartialTensorShape shape, DataType dtype) | |
Variable (const :: tensorflow::Scope & scope, PartialTensorShape shape, DataType dtype, const Variable::Attrs & attrs) |
תכונות ציבוריות | |
---|---|
operation | |
ref |
תפקידים ציבוריים | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
פונקציות סטטיות ציבוריות | |
---|---|
Container (StringPiece x) | |
SharedName (StringPiece x) |
מבנים | |
---|---|
tensorflow:: ops:: משתנה:: Attrs | קובעי תכונות אופציונליים עבור Variable . |
תכונות ציבוריות
מִבצָע
Operation operation
ref
::tensorflow::Output ref
תפקידים ציבוריים
מִשְׁתַנֶה
Variable( const ::tensorflow::Scope & scope, PartialTensorShape shape, DataType dtype )
מִשְׁתַנֶה
Variable( const ::tensorflow::Scope & scope, PartialTensorShape shape, DataType dtype, const Variable::Attrs & attrs )
צוֹמֶת
::tensorflow::Node * node() const
מפעיל::tensorflow::קלט
operator::tensorflow::Input() const
אופרטור::tensorflow::פלט
operator::tensorflow::Output() const
פונקציות סטטיות ציבוריות
מְכוֹלָה
Attrs Container( StringPiece x )
שם משותף
Attrs SharedName( StringPiece x )
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 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```"]]