You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/04/15 19:07:37 UTC
[GitHub] [tvm] vvchernov commented on a diff in pull request #11003: [VirtualMachine] Zero copy in set_input when input is DLTensor
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: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org