Skip to content

Commit

Permalink
Improve error message in NDArray::CopyFromTo (#16539)
Browse files Browse the repository at this point in the history
Make it explicit that the quoted numbers are bytes.
  • Loading branch information
ekalda committed Feb 13, 2024
1 parent b04b1ac commit bb2adbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/ndarray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void NDArray::CopyFromBytes(const void* data, size_t nbytes) {
void NDArray::CopyFromTo(const DLTensor* from, DLTensor* to, TVMStreamHandle stream) {
size_t from_size = GetDataSize(*from);
size_t to_size = GetDataSize(*to);
ICHECK_EQ(from_size, to_size) << "TVMArrayCopyFromTo: The size must exactly match";
ICHECK_EQ(from_size, to_size) << "TVMArrayCopyFromTo: The size in bytes must exactly match.";

ICHECK(from->device.device_type == to->device.device_type || from->device.device_type == kDLCPU ||
to->device.device_type == kDLCPU || from->device.device_type == kDLCUDAHost ||
Expand Down

0 comments on commit bb2adbf

Please sign in to comment.