lazycal commented on a change in pull request #10172:
URL: https://github.com/apache/tvm/pull/10172#discussion_r800855224
##########
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 don't know if they can be floats. So I added that conservative line of
code that only acts on integers. If they can only be integer we should add that
`ICHECK` you mention.
--
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]