MCPcopy Create free account
hub / github.com/pytorch/pytorch / storage

Method storage

torch/_tensor.py:222–238  ·  view source on GitHub ↗

r""" storage() -> torch.TypedStorage Returns the underlying :class:`TypedStorage`. .. warning:: :class:`TypedStorage` is deprecated. It will be removed in the future, and :class:`UntypedStorage` will be the only storage class. To access the

(self)

Source from the content-addressed store, hash-verified

220 return (_rebuild_from_type_v2, (func, type(self), args, state))
221
222 def storage(self):
223 r"""
224 storage() -> torch.TypedStorage
225
226 Returns the underlying :class:`TypedStorage`.
227
228 .. warning::
229
230 :class:`TypedStorage` is deprecated. It will be removed in the future, and
231 :class:`UntypedStorage` will be the only storage class. To access the
232 :class:`UntypedStorage` directly, use :attr:`Tensor.untyped_storage()`.
233 """
234 if has_torch_function_unary(self):
235 return handle_torch_function(Tensor.storage, (self,), self)
236
237 torch.storage._warn_typed_storage_removal(stacklevel=2)
238 return self._typed_storage()
239
240 # For internal use only, to avoid raising deprecation warning
241 def _typed_storage(self):

Calls 2

_typed_storageMethod · 0.95
handle_torch_functionFunction · 0.90