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:21:20 UTC

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

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


##########
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:
   Probably we can remove `Downcast<IndexMap>` at L1083 and L1085?



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