How to use the control_dependencies Tensorflow method?

I want to use Python to work with Tensorflow(deep learning library)
I want an example illustrating the use of a function control_dependencies, for example, I want to create two tensorsX and Y,

ifX == Y thentype "yes"
source code:

import tensorflow as tf


session = tf.Session()

x= tf.constant(5)
y= tf.constant(50)


with tf.control_dependencies([ tf.assert_equal(x,y)])   :
  print('yup')

Usually nothing appears, but its print: yup so why print yup?

+4
source share
1 answer

control_dependencies . ops, ( , , , control_dependencies, , -). -, .

control_dependencies, , , , batchnorm .

+9

Source: https://habr.com/ru/post/1669059/


All Articles