You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/12/06 19:24:56 UTC

[GitHub] [tvm] vinx13 commented on a diff in pull request #13565: [TIR] Fix predefined inverse map in layout transform dtype legalization

vinx13 commented on code in PR #13565:
URL: https://github.com/apache/tvm/pull/13565#discussion_r1041368715


##########
src/tir/schedule/primitive/layout_transformation.cc:
##########
@@ -1079,7 +1079,13 @@ IndexMap LegalizeIndexMapDType(const IndexMap& index_map, const Buffer& buf) {
       return SubstituteWithDataTypeLegalization(index,
                                                 [&](const Var& var) { return var_map.Get(var); });
     });
-    return IndexMap(initial_indices, final_indices);
+    Optional<IndexMap> opt_inverse_index_map =
+        Downcast<Optional<IndexMap>>(index_map->inverse_index_map);
+    if (opt_inverse_index_map.defined()) {
+      IndexMap inverse_index_map = Downcast<IndexMap>(opt_inverse_index_map.value());
+      opt_inverse_index_map = LegalizeIndexMapDType(inverse_index_map, final_indices);

Review Comment:
   updated, I'm keeping L1083 as `inverse_index_map` is defined as `Optional<ObjectRef>` 



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org