mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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
This commit is contained in:
@ -24,8 +24,9 @@ def manual_seed(seed):
|
||||
`torch._C.Generator` object.
|
||||
|
||||
Args:
|
||||
seed (int or long): The desired seed.
|
||||
seed (int): The desired seed.
|
||||
"""
|
||||
seed = int(seed)
|
||||
import torch.cuda
|
||||
|
||||
if not torch.cuda._in_bad_fork:
|
||||
|
||||
Reference in New Issue
Block a user