Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
tensoreflusso:: ops:: Variabile
#include <state_ops.h>
Mantiene lo stato sotto forma di un tensore che persiste attraverso i passaggi.
Riepilogo
Emette un riferimento allo stato del tensore in modo che possa essere letto o modificato. TODO(zhifengc/mrry): aggiunge un puntatore a un documento più dettagliato sulla condivisione degli stati in tensorflow.
Argomenti:
- scope: un oggetto Scope
- forma: la forma del tensore variabile.
- dtype: il tipo di elementi nel tensore variabile.
Attributi facoltativi (vedi Attrs
):
- contenitore: se non vuota, questa variabile viene inserita nel contenitore specificato. Altrimenti, viene utilizzato un contenitore predefinito.
- shared_name: se non vuoto, questa variabile viene denominata nel bucket specificato con questo shared_name. In caso contrario, viene utilizzato il nome del nodo.
Resi:
-
Output
: un riferimento alla variabile tensore.
Attributi pubblici
Funzioni pubbliche
Variabile
Variable(
const ::tensorflow::Scope & scope,
PartialTensorShape shape,
DataType dtype
)
nodo
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operatore::tensorflow::Output
operator::tensorflow::Output() const
Funzioni pubbliche statiche
Contenitore
Attrs Container(
StringPiece x
)
Nome condiviso
Attrs SharedName(
StringPiece x
)
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 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```"]]