mbs-octoml commented on code in PR #11003:
URL: https://github.com/apache/tvm/pull/11003#discussion_r851416661
##########
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:
Thank you, this is a great change.
Could you update vm.py's set_input doc string to clearly state the by-copy
vs by-ref semantics? Thanks.
--
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]