lazycal commented on a change in pull request #10118:
URL: https://github.com/apache/tvm/pull/10118#discussion_r796979604



##########
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:
       Thanks for having me in your discussion. I agree on an entire rewrite. 
Ping me in discuss forum when you some day decide to do it :-), and I'd love to 
participate.




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


Reply via email to