I understand that tf.where will return the locations of True values, so that I could use the result\'s shape[0] to get the number of <
tf.where
True
shape[0]
You can cast the values to floats and compute the sum on them: tf.reduce_sum(tf.cast(myOtherTensor, tf.float32))
tf.reduce_sum(tf.cast(myOtherTensor, tf.float32))
Depending on your actual use case you can also compute sums per row/column if you specify the reduce dimensions of the call.