utils.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:RFHO 作者: lucfra 项目源码 文件源码
def assign(self, value, use_locking=False):
        """
        Behaves as tf.Variable.assign, building assign ops for the underlying (original) Variables


        :param value: rank-1 tensor. Assumes it has the same structure as the tensor contained in the object.
        :param use_locking: (optional) see use_locking in `tf.Variables.assign`
        :return: A list of `tf.Variables.assign` ops.
        """
        assign_ops = [
            wsr(v.assign(reshape(value), use_locking=use_locking)) for v, reshape in self.chunks_info_dict.items()
        ]
        return tf.group(*assign_ops)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号