mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[easy] better copy_misaligned_inputs assertion failure message (#154472)
internal xref: https://fb.workplace.com/groups/1075192433118967/permalink/688540560729579/ Pull Request resolved: https://github.com/pytorch/pytorch/pull/154472 Approved by: https://github.com/williamwen42
This commit is contained in:
committed by
PyTorch MergeBot
parent
2e9bd03f60
commit
6b45af38a5
@ -2752,7 +2752,9 @@ def copy_misaligned_inputs(
|
||||
ret_pair_defined = return_pair_idxs is not None
|
||||
for i in check_inputs_idxs:
|
||||
_inp = new_inputs[i]
|
||||
assert isinstance(_inp, torch.Tensor)
|
||||
assert isinstance(_inp, torch.Tensor), (
|
||||
f"Expected tensors only, but got: {type(_inp)}"
|
||||
)
|
||||
if _inp.data_ptr() % ALIGNMENT:
|
||||
new_inputs[i] = clone_preserve_strides(_inp)
|
||||
|
||||
|
Reference in New Issue
Block a user