i'm new in Tensorflow.
i have one question.
there is 1d array here.
values = [101,103,105,109,107]
target_values = [105, 103]
I want to get an indices about target_values from values at once.
Indices extracted from the example above will be shown below.
indices = [2, 1]
when i using tf.map_fn function.
This problem can be solved easily.
# if you do not change data type from int64 to int32. TypeError will riase
values = tf.cast(tf.constant([100, 101, 102, 103, 104]), tf.int64)
target_values = tf.cast(tf.constant([100, 101]), tf.int64)
indices = tf.map_fn(lambda x: tf.where(tf.equal(values, x)), target_values)
thank you!