How do I get the current value of a Variable?

后端 未结 4 702
走了就别回头了
走了就别回头了 2020-12-04 21:49

Suppose we have a variable:

x = tf.Variable(...)

This variable can be updated during the training process using the assign() m

4条回答
  •  悲哀的现实
    2020-12-04 22:26

    As they cancelled tf.Variable() in tensorflow 2.0.0,

    If you want to extract values from a tensor(ie "net"), you can use this,

    net.[tf.newaxis,:,:].numpy().
    

提交回复
热议问题