I have a float tensor with shape (1) whose value lies between 0.0 and 1.0. I want to 'bin' the range in this tensor, as in:
if 0.0 < x < 0.2:
return tf.Constant([0])
if 0.2 < x < 0.4:
return tf.Constant([1])
if 0.4 < x < 0.6:
return tf.Constant([2])
if 0.6 < x:
return tf.Constant([3])
No idea how to do it!