zhiics commented on a change in pull request #5128: [Refactor] Relay Node::make
to constructor
URL: https://github.com/apache/incubator-tvm/pull/5128#discussion_r396177006
##########
File path: src/tir/ir/data_layout.cc
##########
@@ -350,20 +350,16 @@ Array<PrimExpr> BijectiveLayout::BackwardShape(const
Array<PrimExpr>& shape) con
self->src_layout->axes, self->backward_rule);
}
-BijectiveLayout BijectiveLayoutNode::make(const Layout& src_layout,
- const Layout& dst_layout) {
+BijectiveLayout::BijectiveLayout(Layout src_layout, Layout dst_layout) {
auto n = make_object<BijectiveLayoutNode>();
- n->src_layout = src_layout;
- n->dst_layout = dst_layout;
+ n->src_layout = std::move(src_layout);
+ n->dst_layout = std::move(dst_layout);
- if (!GetStoreRule(&n->forward_rule, n->src_layout, n->dst_layout)) {
- // not convertible
- return BijectiveLayout();
+ if (GetStoreRule(&n->forward_rule, n->src_layout, n->dst_layout)) {
Review comment:
@yzhliu @anijain2305 please take a look here
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services