You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tvm.apache.org by Trevor Morris via TVM Discuss <no...@discuss.tvm.ai> on 2020/04/03 17:03:59 UTC

[TVM Discuss] [Development/RFC] Slice_like can't be constant folded


The slice_like operator takes two inputs:
1. Data tensor to be sliced.
2. Tensor, from which shape will be used to slice input 1.

In many object detection networks, input 1 is a constant and the shape of input 2 is known statically. 
To perform this operation only the shape of input 2 is needed. However, the FoldConstant pass doesn't know this and will see that since input 2 is not a constant, the operation will not be constant folded.

To fix this, I want to add a pass to simplify slice_like to strided_slice when the necessary shapes of input 2 are available statically. Any thoughts?





---
[Visit Topic](https://discuss.tvm.ai/t/slice-like-cant-be-constant-folded/6206/1) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/112f98dada34dd87b30ac58a0fc7c7aa3a43918fec73b36480a08638ba349ab6).

[TVM Discuss] [Development/RFC] Slice_like can't be constant folded

Posted by Yao Wang via TVM Discuss <no...@discuss.tvm.ai>.

In the long term, we probably want to improve FoldConstant to hint that for some op such as shapeof, we just need its input shape to be constant. In the short term, I'm not very sure about whether we need a pass specifically for it. Another way is we just modify the frontend to infer_value for the second input of slice_like.





---
[Visit Topic](https://discuss.tvm.ai/t/slice-like-cant-be-constant-folded/6206/3) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/c1418c057990fe625220ee91a608c09054e99c00ca384f34550c8b4490030301).

[TVM Discuss] [Development/RFC] Slice_like can't be constant folded

Posted by Zhi via TVM Discuss <no...@discuss.tvm.ai>.

I am not sure. But I sort of remember that striced_slice may also need to change the `begin` and `end` into expr for dynamic shapes. @kevinthesun and @yongwww can comment more on this.





---
[Visit Topic](https://discuss.tvm.ai/t/slice-like-cant-be-constant-folded/6206/2) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/370f557455e3b15788636df9f9e2542d4f90c172bdfee3c8accee142be340516).