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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]