honghuichao opened a new issue, #12486: URL: https://github.com/apache/tvm/issues/12486
Thanks for participating in the TVM community! We use https://discuss.tvm.ai for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first :smile_cat: Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed. ### Can the following code accept a tuple as input? /*! * \brief Defines the call transformation for AlterOpLayout pass. The new layouts are defined by * used for different targets using a packed func. * \param ref_call The original call. * \param new_attrs Updated attributes consistent with new layouts. * \param new_args The traversed/recursed args to the call. * \return The new Call after calling the packed func. */ Call CallWithNewLayouts(const Call& ref_call, Attrs new_attrs, const std::vector<Expr>& new_args) override { static auto falter_layout = Op::GetAttrMap<FTVMAlterOpLayout>("FTVMAlterOpLayout"); Op op = Downcast<Op>(ref_call->op); Expr new_e; bool modified = false; if (falter_layout.count(op)) { tvm::Array<tvm::te::Tensor> tinfos; for (auto expr : ref_call->args) { auto ttype = expr->type_as<TensorTypeNode>(); tinfos.push_back(tvm::te::placeholder(ttype->shape, ttype->dtype)); } // TODO(@kevinthesun, @icemelon9): This won't work if inputs/outputs are dynamic shapes. // Probably we need to disable the AlterOpLayout when compiling dynamic models. Expr altered_value = falter_layout[op](new_attrs, new_args, tinfos, ref_call->checked_type()); if (altered_value.defined()) { new_e = altered_value; modified = true; } } if (!modified) { new_e = Call(ref_call->op, new_args, new_attrs); } const CallNode* new_call = new_e.as<CallNode>(); ICHECK(new_call) << "Can only replace the original operator with another call node"; return GetRef<Call>(new_call); } -- 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]
