diff options
author | Sam Gross <colesbury@gmail.com> | 2017-01-18 03:22:30 -0500 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2017-01-18 03:22:30 -0500 |
commit | 6464e69e21ac364b32ab99920215b281c5361a31 (patch) | |
tree | d6e60f49524169300e8ef244cea7f80a53854a75 /torch/_utils.py | |
parent | a93812e4e59c45e69ee8a0b53a4532320978690c (diff) | |
download | pytorch-6464e69e21ac364b32ab99920215b281c5361a31.tar.gz pytorch-6464e69e21ac364b32ab99920215b281c5361a31.tar.bz2 pytorch-6464e69e21ac364b32ab99920215b281c5361a31.zip |
Docs for torch.Storage (#475)
Diffstat (limited to 'torch/_utils.py')
-rw-r--r-- | torch/_utils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/torch/_utils.py b/torch/_utils.py index 658d806ccc..20a2400d15 100644 --- a/torch/_utils.py +++ b/torch/_utils.py @@ -2,6 +2,18 @@ import torch def _type(self, new_type=None, async=False): + """Casts this object to the specified type. + + If this is already of the correct type, no copy is performed and the + original object is returned. + + Args: + new_type (type or string): The desired type + async (bool): If True, and the source is in pinned memory and + destination is on the GPU or vice versa, the copy is + performed asynchronously with respect to the host. + Otherwise, the argument has no effect. + """ if new_type is None: return self.__module__ + '.' + self.__class__.__name__ |