From cac467bdb5cd64457312dac2eb579312e068d917 Mon Sep 17 00:00:00 2001 From: Elen Kalda Date: Wed, 7 Feb 2024 13:55:56 +0000 Subject: [PATCH] Improve error message in NDArray::CopyFromTo Make it explicit that the quoted numbers are bytes. --- src/runtime/ndarray.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/ndarray.cc b/src/runtime/ndarray.cc index e47a399ae5fc..675ee62a0511 100644 --- a/src/runtime/ndarray.cc +++ b/src/runtime/ndarray.cc @@ -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 ||