When the Tensorflow Frontend of TVM
handles the strided_slice
op after shape_of
, the special routine to handle the strided_slice
op after shape_of
may generate bugs under certain circumstances.
These bugs happen because the special routine may incorrectly conclude that the out_data
is static.
This can be reproduced by this :
def slice_lab():
debug_graph = tf.Graph()
with debug_graph.as_default():
t = tf.placeholder(dtype=tf.float32, shape=(None, None), name='input')
s1 = tf.shape(t)
st2 = tf.strided_slice(s1, [1], [2], [1], name='st2')
mod, params = relay.frontend.from_tensorflow(
debug_graph.as_graph_def(),
layout='NCHW',
outputs=['st2']
)
print(mod['main'])
The output logs, which is clearly wrong:
fn () -> Tensor[(0), int32] {
meta[relay.Constant][0] /* ty=Tensor[(0), int32] */
}