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

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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?