a = tf.constant([[1,2,3],[4,5,6]])
b = tf.constant([True, False], dtype=tf.bool)
a.eval()
array([[1, 2, 3],
[4, 5, 6]], dtype=int32)
b.eval()
array([ True, False], dtype=bool)
I want to apply a functions to the inputs above, a
, and b
using tf.map_fn
. It will input both [1,2,3]
, and True
and output similar values.
Let's say out function is simply the identity: lambda(x,y): x,y
so, given an input of [1,2,3], True
, it will output those identical tensors.
I know how to use tf.map_fn(...)
with one variable, but not with two. And in this case I have mixed data types (int32 and bool) so I can't simply concatenate the tensors and split them after the call.
Can I use tf.map_fn(...)
with multiple inputs/outputs of different data types?