1

Based on this post, we can change the tf.variable

threshold = 3
a = np.array([1,2,3,4,5,6])
b = tf.Variable(a)
b = tf.where(b >= threshold, 199, b)

Will b=tf.where(b>=3, 199, b) be plugin to the computational graph and affect the gradient of b in the back propragration?

Or more general questions: What types of operations will/will not plugin the computational graph in the Tensorflow 2?

jason
  • 1,998
  • 3
  • 22
  • 42

0 Answers0