tensorflow Using if condition inside the TensorFlow graph with tf.cond

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Parameters

ParameterDetails
preda TensorFlow tensor of type bool
fn1a callable function, with no argument
fn2a callable function, with no argument
name(optional) name for the operation

Remarks

  • pred cannot be just True or False, it needs to be a Tensor
  • The function fn1 and fn2 should return the same number of outputs, with the same types.


Got any tensorflow Question?