vvchernov commented on code in PR #11003:
URL: https://github.com/apache/tvm/pull/11003#discussion_r851441091


##########
src/runtime/vm/vm.cc:
##########
@@ -303,13 +303,12 @@ void 
VirtualMachine::SetInputTensorWithIndex(std::vector<ObjectRef>& tensors,
   if (inp_tensor.type_code() == kTVMDLTensorHandle) {
     // Automatically convert input DLTensors to NDArray
     DLTensor* tensor = inp_tensor;
-    std::vector<int64_t> shape;
-    for (int64_t i = 0; i < tensor->ndim; i++) {
-      shape.push_back(tensor->shape[i]);
+    if (dev.device_type == tensor->device.device_type &&

Review Comment:
   Hello @mbs-octoml! I've added description and check device id for NDArray. 
But it looks like internal mechanism of copying does not take into account 
device id. Please see my changes



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

Reply via email to