You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "tqchen (via GitHub)" <gi...@apache.org> on 2023/11/01 15:47:41 UTC
Re: [PR] [Draft][Unity] Allow dynamic indices to TupleGetItem [tvm]
tqchen commented on code in PR #16002:
URL: https://github.com/apache/tvm/pull/16002#discussion_r1378977128
##########
src/contrib/msc/core/transform/set_expr_layout.cc:
##########
@@ -48,10 +48,14 @@ LayoutDecision InferLayoutDecision(const Expr& expr, const VarLayoutMap& var_lay
}
LayoutDecision InferLayoutDecisionAt(const Expr& expr, const VarLayoutMap& var_layout_map,
- size_t index = 0) {
+ Expr index = PrimValue::Int64(0)) {
const auto& nlayouts = InferNLayout(expr, var_layout_map);
if (nlayouts.IsLeaf()) {
- return index == 0 ? nlayouts.LeafValue() : LayoutDecision("");
+ auto int_index = Downcast<PrimStructInfo>(index->struct_info_)
+ ->value.as<IntImm>()
+ .value_or(Integer(0))
Review Comment:
The comment is not about requesting changes. Mainly to illustrate that there is a gap and added burden if we go with the generalized TupleGetItem route. So the suggestion is to introduce a separate operator for such cases.
--
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