PyTorch torch.is_storage function
PyTorch torch reference manual
torch.is_storage A function in PyTorch for checking whether an object is a storage object.
Function definition
torch.is_storage(obj)
Usage examples
Example
import
torch
Creating tensors
x
=
torch.
tensor
(
[
1
,
2
,
3
]
)
Check whether it is a storage object
(
torch.
is_storage
(
x
)
)
(
torch.
is_storage
(
x.
storage
(
)
)
)
The output is:
False
True