masahi commented on code in PR #14548:
URL: https://github.com/apache/tvm/pull/14548#discussion_r1162197406


##########
include/tvm/topi/transform.h:
##########
@@ -2035,6 +2034,73 @@ inline Tensor adv_index(const Tensor& data, const 
Array<Tensor>& indices,
       name, tag);
 }
 
+namespace relax {
+// relax dynamic slice
+inline te::Tensor dynamic_strided_slice(const te::Tensor& x, const te::Tensor& 
begin,
+                                        const te::Tensor& end, const 
te::Tensor& strides,
+                                        Array<PrimExpr> output_shape,
+                                        std::string name = 
"T_strided_slice_dynamic",
+                                        std::string tag = kInjective) {

Review Comment:
   sorry maybe I'm confused about the existing implementation of 
`dynamic_strided_slice` and its relation with `strided_slice` shape func. If 
`dynamic_strided_slice` can calculate the right output shape from its dynamic 
input, why do we need a shape func for it at all... And why this new definition 
of `dynamic_strided_slice` needs to have its output shape calculated by the 
shape func ahead of time.



##########
include/tvm/topi/transform.h:
##########
@@ -2035,6 +2034,73 @@ inline Tensor adv_index(const Tensor& data, const 
Array<Tensor>& indices,
       name, tag);
 }
 
+namespace relax {
+// relax dynamic slice
+inline te::Tensor dynamic_strided_slice(const te::Tensor& x, const te::Tensor& 
begin,
+                                        const te::Tensor& end, const 
te::Tensor& strides,
+                                        Array<PrimExpr> output_shape,
+                                        std::string name = 
"T_strided_slice_dynamic",
+                                        std::string tag = kInjective) {

Review Comment:
   sorry maybe I'm confused about the existing implementation of 
`dynamic_strided_slice` and its relation with `strided_slice` shape func.
   
    If `dynamic_strided_slice` can calculate the right output shape from its 
dynamic input, why do we need a shape func for it at all... And why this new 
definition of `dynamic_strided_slice` needs to have its output shape calculated 
by the shape func ahead of time.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to