masahi commented on a change in pull request #10118:
URL: https://github.com/apache/tvm/pull/10118#discussion_r796509866
##########
File path: src/relay/transforms/transform_layout.h
##########
@@ -371,6 +375,17 @@ Expr LayoutRewriter(const Call& ref_call, const
Array<Expr>& new_args, const Obj
ICHECK_EQ(new_in.size(), new_in2.size())
<< "The number of input nodes should keep the same during
alter_op_layout";
+ auto transform_layout = [&memorizer](Expr arg_item, const Layout& old_in,
const Layout& old_in2,
+ const Layout& new_in, const Layout&
new_in2) {
+ if (old_in2.Equals(old_in)) { // the two transforms can be fused to one
+ arg_item = memorizer.Transform(arg_item, new_in, new_in2);
+ } else {
+ if (old_in.defined()) arg_item = memorizer.Transform(arg_item, new_in,
old_in);
+ arg_item = memorizer.Transform(arg_item, old_in2, new_in2);
Review comment:
In this code path, `old_in != old_in2`. So after the transform at L383,
how is it possible that we can apply another transform with `old_in2` as the
src layout?
--
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]