diff options
author | Sam Gross <colesbury@gmail.com> | 2018-02-23 18:03:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-23 18:03:31 -0500 |
commit | 30ec06c140b0428d591e2f5007bc8046d1bdf7c4 (patch) | |
tree | acc85b21005e57dcf2f3a2326cea5ca90b99249f /test/test_multiprocessing.py | |
parent | 7a36c132cef1c3256a26048251ef022f60e22f3e (diff) | |
download | pytorch-30ec06c140b0428d591e2f5007bc8046d1bdf7c4.tar.gz pytorch-30ec06c140b0428d591e2f5007bc8046d1bdf7c4.tar.bz2 pytorch-30ec06c140b0428d591e2f5007bc8046d1bdf7c4.zip |
Merge Variable and Tensor classes (#5225)
This replaces the torch.Tensor constructors with factories that produce
Variables. Similarly, functions on the torch module (e.g. torch.randn)
now return Variables.
To keep the PR to a reasonable size, I've left most of the unused tensor
code. Subsequent PRs will remove the dead code, clean-up calls to
torch.autograd.Variable, and rename Variable to Tensor everywhere.
There are some breaking changes because Variable and Tensors had
slightly different semantics. There's a list of those changes here:
https://github.com/pytorch/pytorch/wiki/Breaking-Changes-from-Variable-and-Tensor-merge
Diffstat (limited to 'test/test_multiprocessing.py')
-rw-r--r-- | test/test_multiprocessing.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/test_multiprocessing.py b/test/test_multiprocessing.py index 9096965ba1..a23af037db 100644 --- a/test/test_multiprocessing.py +++ b/test/test_multiprocessing.py @@ -60,7 +60,7 @@ def sum_tensors(inq, outq): with torch.cuda.device(1): tensors = inq.get() for tensor in tensors: - outq.put((tensor.sum(), tensor.get_device(), + outq.put((tensor.sum().item(), tensor.get_device(), tensor.numel(), tensor.storage().size())) |