zhiics commented on a change in pull request #6337:
URL: https://github.com/apache/incubator-tvm/pull/6337#discussion_r479481384
##########
File path: src/runtime/vm/vm.cc
##########
@@ -68,8 +68,17 @@ inline ObjectRef CopyTo(ObjectRef src, const DLContext& ctx)
{
if (nd_array->ctx.device_type != ctx.device_type) {
return nd_array.CopyTo(ctx);
}
+ return src;
+ } else {
+ CHECK(src->IsInstance<ADTObj>())
+ << "VM data must be NDArray or a list of NDArray, but received: " <<
src->_type_key;
+ std::vector<ObjectRef> ret;
+ ADT adt = Downcast<ADT>(src);
+ for (size_t i = 0; i < adt.size(); i++) {
+ ret.push_back(CopyTo(adt[i], ctx));
+ }
+ return ADT(0, ret.begin(), ret.end());
Review comment:
Yeah, for the input we only used Tuple whose tag is 0. But you are
right, it's better to use tag.
----------------------------------------------------------------
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]