Hi guys. I am new to mxnet. Now I want to add some conditional control in my network. I notice that sym.where can do this work by using:
f_x = a - b
f_y = a + b
result = mx.sym.where(condition=gt, f_x, f_y)
I am curious to know, if the condition is true, will f_y=a+b be executed ? (maybe f_y is executed but the result will not be returned? )
I read the example of tensorflow, the explanation is quite clear:
z = tf.multiply(a, b)
result = tf.cond(x < y, lambda: tf.add(x, z), lambda: tf.square(y))
If x < y, the tf.add operation will be executed and tf.square operation will not be executed.
So, is mx.sym.where equivalent to tf.cond? Thanks.