Here you return the results of the tf.while loop. the tf.while returns a tuple of several values, in your case we see that your while loop returned the value of interest and the counter value as a tuple.
(<tf.Tensor 'map_2/while/while/Exit_1:0' shape=(20,) dtype=float32>, <tf.Tensor 'map_2/while/Sub:0' shape=() dtype=int64>)
What you want to pass from map_fn is perhaps only the first of these two values. Therefore, in code that you have not shown here, you should have something like:
value, counter = tf.while(...) return value
What do you have:
return tf.while(...)
So the error you see complains that <dtype: 'int64'> does not match the tuple that you are passing. When you fix the while loop, you will compare <dtype: 'int64'> with <tf.Tensor 'map_2/while/while/Exit_1:0' shape=(20,) dtype=float32> , which is supposedly (20,) and will match (although you may encounter an int / float problem).
source share