tf.assign

assign(
ref,
value,
validate_shape=None,
use_locking=None,
name=None
)

Defined in tensorflow/python/ops/state_ops.py.

将 value 赋值给 ref,并输出 ref

这使得需要使用复位值的连续操作变简单

Defined in tensorflow/python/framework/tensor_shape.py.

Args :

  • ref: A mutable Tensor. Should be from a Variable node. May be uninitialized.
  • value: A Tensor. Must have the same type as ref. The value to be assigned to the variable.
  • validate_shape: An optional bool. Defaults to True. 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: An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
  • name: A name for the operation (optional).

Returns :
Same as "ref". Returned as a convenience for operations that want to use the new value after the variable has been reset.



最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 中华民族似乎很看重“和”,一向提倡“以和为贵”。比如,在处理家庭关系时,倡导“家和万事兴”;在处理人...
    152星球阅读 1,280评论 0 0
  • 叹银汉迢迢,七夕鹊桥,众人知真情相守,何人解苦思多少,天宫广阙孤寒,红尘恋,方铸万古谣。 若归来凡尘,万千...
    七音听雨阅读 3,523评论 1 6
  • 安好_6f4b阅读 2,732评论 1 0