Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::Assign
#include <state_ops.h>
Update 'ref' by assigning 'value' to it.
Summary
This operation outputs "ref" after the assignment is done. This makes it easier to chain operations that need to use the reset value.
Arguments:
- scope: A Scope object
- ref: Should be from a
Variable
node. May be uninitialized.
- value: The value to be assigned to the variable.
Optional attributes (see Attrs
):
- validate_shape: If true, the operation will validate that the shape of 'value' matches the shape of the Tensor being assigned to. If false, 'ref' will take on the shape of 'value'.
- use_locking: If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
Output
: = Same as "ref". Returned as a convenience for operations that want to use the new value after the variable has been reset.
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
UseLocking
Attrs UseLocking(
bool x
)
ValidateShape
Attrs ValidateShape(
bool x
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-04-20 UTC.
[null,null,["Last updated 2020-04-20 UTC."],[],[],null,["# tensorflow::ops::Assign Class Reference\n\ntensorflow::ops::Assign\n=======================\n\n`#include \u003cstate_ops.h\u003e`\n\nUpdate 'ref' by assigning 'value' to it.\n\nSummary\n-------\n\nThis operation outputs \"ref\" after the assignment is done. This makes it easier to chain operations that need to use the reset value.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- ref: Should be from a [Variable](/versions/r1.15/api_docs/cc/class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable) node. May be uninitialized.\n- value: The value to be assigned to the variable.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs)):\n\n- validate_shape: If true, the operation will validate that the shape of 'value' matches the shape of the [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) being assigned to. If false, 'ref' will take on the shape of 'value'.\n- use_locking: If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): = Same as \"ref\". Returned as a convenience for operations that want to use the new value after the variable has been reset.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Assign](#classtensorflow_1_1ops_1_1_assign_1a9d092527e56dc2c2349ea73d983cf65d)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` ref, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` value)` ||\n| [Assign](#classtensorflow_1_1ops_1_1_assign_1a8ba8288a592f24c065bcae0d32b770f6)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` ref, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` value, const `[Assign::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_assign_1a5d4c946cbed23867a165f2da7f908730) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_ref](#classtensorflow_1_1ops_1_1_assign_1a20cf92e3af8c7164b3eb17ee05479ac2) | `::`[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_assign_1a4ec3c136c0a49e9b3e9312cdb704455f)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_assign_1a3a8d284c3415f19eb7954bbf703b7af2)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_assign_1aedefc46ede817c8851373351603d9508)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|\n| [UseLocking](#classtensorflow_1_1ops_1_1_assign_1a013fcdc58dfe9ea5bfd88550e231d936)`(bool x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs) |\n| [ValidateShape](#classtensorflow_1_1ops_1_1_assign_1adfed4e6b56c404a19c1a4eb89e4277c8)`(bool x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs) |\n\n| ### Structs ||\n|--------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::Assign::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/assign/attrs) | Optional attribute setters for [Assign](/versions/r1.15/api_docs/cc/class/tensorflow/ops/assign#classtensorflow_1_1ops_1_1_assign). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output_ref\n\n```scdoc\n::tensorflow::Output output_ref\n``` \n\nPublic functions\n----------------\n\n### Assign\n\n```gdscript\n Assign(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input ref,\n ::tensorflow::Input value\n)\n``` \n\n### Assign\n\n```gdscript\n Assign(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input ref,\n ::tensorflow::Input value,\n const Assign::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### UseLocking\n\n```text\nAttrs UseLocking(\n bool x\n)\n``` \n\n### ValidateShape\n\n```text\nAttrs ValidateShape(\n bool x\n)\n```"]]