I have a Tensorflow model with some unsupported operators and among them there is the “Where” operator. After checking the Relay IR operators it seems the Where operator is supported but exposed in the Tensorflow frontend as a Select operator.
Could someone clarify why is this the case? Are Select and where equivalent? Could I extend the Tensorflow frontend by adding an entry to include the “Where” operator just like “Select”?
Yes that is my feeling that where are select are the same, but I have not been able to confirm this by looking at the TF documentation. Maybe someone in the community can clarify this.
It seems that Select is deprecated and where should be used instead. I am wondering if some could clarify this and why Select is the one used in the Tensorflow frontend.
Moreover, the Select operator invokes the where function in the Tensorflow frontend:
@tico we saw the same issue before, I added Select. If you saw Where in your model, very likely your model was trained with very old tf version. Select is the c++ operator for tf.where() now. So the where should be gone if you use new tf version (>=1.0).
BTW, I am happy to add Where support if you have a small python test case to help reproduce
Thanks @lixiaoquan for pointing this out. Now I have the test case as below for Where. Since the output shape may vary based on the number of true elements. Then adding support for Where needs to rely on dynamism on which folks are working.
condition = [[True,False,False],
[False,True,True]]
with tf.Session() as sess:
print(sess.run(tf.where(condition)))
So you mean that currently “Where” does not support the case of only one parameter, and we need to wait until the TensorArray is supported. Is my understanding correct? thanks! @yongwww