ganler commented on a change in pull request #10172:
URL: https://github.com/apache/tvm/pull/10172#discussion_r800307383



##########
File path: src/tir/transforms/narrow_datatype.cc
##########
@@ -253,6 +253,23 @@ class DataTypeRewriter : public StmtExprMutator {
     return StmtExprMutator::VisitExpr_(op);
   }
 
+  PrimExpr VisitExpr_(const RampNode* op) final {
+    PrimExpr base = VisitExpr(op->base);
+    PrimExpr stride = VisitExpr(op->stride);
+    if (base.same_as(op->base) && stride.same_as(op->stride)) {
+      return GetRef<PrimExpr>(op);
+    } else {
+      if (base.dtype().is_int()) {
+        ICHECK(stride.dtype().is_int()) << "Ramp base is int but stride is " 
<< stride.dtype();

Review comment:
       I think we can simply assume that base and stride should be of integer 
types. However, I also noticed that in 
   
   
https://github.com/apache/tvm/blob/22c488e3a829ad700de6547be6096fb2d1f02e81/src/tir/ir/expr.cc#L705
   
   Such assumptions are not checked. I am a bit curious if there will be, say 
`base/stride` in float types?




-- 
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