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 2021/11/18 19:18:15 UTC

[GitHub] [tvm] tqchen commented on a change in pull request #9533: [Draft] WithFields for Tuples

tqchen commented on a change in pull request #9533:
URL: https://github.com/apache/tvm/pull/9533#discussion_r752552991



##########
File path: src/relay/ir/expr.cc
##########
@@ -71,6 +71,29 @@ Tuple::Tuple(tvm::Array<relay::Expr> fields, Span span) {
   data_ = std::move(n);
 }
 
+Tuple Tuple::WithFields(Optional<Array<Expr>> opt_fields, Optional<Span> opt_span) {
+  Array<Expr> fields = opt_fields.value_or(get()->fields);

Review comment:
       you want to make it as a global function https://github.com/apache/tvm/blob/main/include/tvm/ir/attrs.h#L371, so that you do std::move and COW when there is a single copy. 




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