如果我有如下构造的张量流图
a = tf.Variable(0.8, name='a')
b = tf.Variable(0.6, name='b')
c = tf.Variable(0.4, name='c')
ab = tf.mul(a, b, name='mul_ab')
abc = tf.mul(ab, c, name='mul_abc')
有没有办法在执行这五行之后在mul_ab和mul_abc之间插入一个操作?例如,在mul_ab和mul_abc之间插入条件将等同于
生成的图形a = tf.Variable(0.8, name='a')
b = tf.Variable(0.6, name='b')
c = tf.Variable(0.4, name='c')
ab = tf.cond(a < tf.constant(1.0), # Arbitrary comparison
lambda: tf.zeros(1), # Arbitrary return value
lambda: tf.mul(a, b, name='mul_ab')) # Original return value
abc = tf.mul(ab, c, name='mul_abc')