mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
avoid allocation when tensor_new from storage (#149797)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/149797 Approved by: https://github.com/Skylion007
This commit is contained in:
parent
112f983056
commit
40ec9d2bfa
|
|
@ -417,7 +417,7 @@ Tensor internal_new_from_data(
|
|||
" or an UntypedStorage, but got ",
|
||||
storage_scalar_type);
|
||||
tensor = at::empty(
|
||||
sizes,
|
||||
{0}, // sizes. Storage will be set later.
|
||||
at::initialTensorOptions()
|
||||
.dtype(
|
||||
is_typed_storage ? storage_scalar_type
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user