guan404ming commented on code in PR #19906:
URL: https://github.com/apache/tvm/pull/19906#discussion_r3490259130


##########
src/tirx/ir/index_map.cc:
##########
@@ -76,14 +76,18 @@ std::pair<IndexMap, PrimExpr> IndexMapInverseImpl(const 
IndexMap& self,
   ffi::Array<Var> output_vars;
   for (size_t i = 0; i < self->final_indices.size(); i++) {
     PrimExpr index = self->final_indices[i];
-    // TODO(Lunderberg): Better names for these variables.  A variable
-    // that is passed through unmodified (`index` is an element of
-    // `initial_indices`) should use that input index's name.  A pair
-    // of output indices variables split from a single input index
-    // should be named (X.outer,X.inner).
-    std::stringstream ss;
-    ss << "axis" << i;
-    Var var_index(ss.str(), index.ty());
+    // A pass-through index keeps the input variable's name for readability.
+    // TODO(Lunderberg): Name a pair of output indices split from a single
+    // input index as (X.outer, X.inner).
+    std::string name;
+    if (auto* var = index.as<VarNode>()) {
+      name = var->name_hint;
+    } else {
+      std::stringstream ss;
+      ss << "axis" << i;
+      name = ss.str();
+    }

Review Comment:
   Fixed



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to