mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Improve Storage copy_ size mismatch error message (#126280)
Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/126280 Approved by: https://github.com/mikaylagawarecki
This commit is contained in:
parent
d15920a7d0
commit
f0d34941dd
1 changed files with 7 additions and 1 deletions
|
|
@ -94,7 +94,13 @@ static PyObject* THPStorage_copy_(
|
|||
TORCH_CHECK(
|
||||
!invalid, "Attempted to call copy_() on an invalid python storage.")
|
||||
|
||||
TORCH_CHECK(self_.nbytes() == src.nbytes(), "size does not match");
|
||||
TORCH_CHECK(
|
||||
self_.nbytes() == src.nbytes(),
|
||||
"size does not match, self was ",
|
||||
self_.nbytes(),
|
||||
" bytes but src was ",
|
||||
src.nbytes(),
|
||||
" bytes");
|
||||
|
||||
at::storage_copy(self_, src, non_blocking);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue