mikepapadim commented on a change in pull request #9569:
URL: https://github.com/apache/tvm/pull/9569#discussion_r755531291
##########
File path: src/relay/transforms/partial_eval.cc
##########
@@ -615,6 +615,8 @@ class PartialEvaluator : public ExprFunctor<PStatic(const
Expr& e, LetList* ll)>
value.push_back(ps);
expr.push_back(ps->dynamic);
}
+ // Note: The partial evaluator seems to do some weird stuff with sharing.
Changing Tuple(expr)
+ // to WithFields(op, expr) causes some strange failures.
return HasStatic(MkSTuple(value), ll->Push(Tuple(expr)));
Review comment:
Can we get capture these failures with some unit-test?
##########
File path: src/relay/ir/expr.cc
##########
@@ -184,6 +290,25 @@ TupleGetItem::TupleGetItem(Expr tuple, int index, Span
span) {
data_ = std::move(n);
}
+TupleGetItem WithFields(TupleGetItem tuple_get_item, Optional<Expr> opt_tuple,
+ Optional<Integer> opt_index, Optional<Span> opt_span) {
+ Expr tuple = opt_tuple.value_or(tuple_get_item->tuple);
+ int index =
+ opt_index.value_or(tuple_get_item->index)
+ ->value; // Is it OK that this is an Integer instead of int? this
lets me use Optional
Review comment:
I think Integer is fine here. Still need this comment?
--
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]