コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
テンソルフロー::作戦::変数
#include <state_ops.h>
ステップ間で持続するテンソルの形式で状態を保持します。
まとめ
読み取りまたは変更できるように、テンソル状態への参照を出力します。 TODO(zhifengc/mrry): tensorflow での状態の共有に関するより詳細なドキュメントへのポインタを追加します。
引数:
- スコープ:スコープオブジェクト
- 形状: 可変テンソルの形状。
- dtype: 変数テンソルの要素のタイプ。
オプションの属性 ( Attrs
を参照):
- コンテナ: 空でない場合、この変数は指定されたコンテナに配置されます。それ以外の場合は、デフォルトのコンテナが使用されます。
- shared_name: 空でない場合、この変数は指定されたバケット内でこのshared_nameで名前が付けられます。それ以外の場合は、代わりにノード名が使用されます。
戻り値:
パブリック属性
公共機能
変数
Variable(
const ::tensorflow::Scope & scope,
PartialTensorShape shape,
DataType dtype
)
ノード
::tensorflow::Node * node() const
operator::tensorflow::Input() const
演算子::tensorflow::出力
operator::tensorflow::Output() const
パブリック静的関数
容器
Attrs Container(
StringPiece x
)
共有名
Attrs SharedName(
StringPiece x
)
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 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```"]]