-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Description
Issue description
torch.expand seems to be not working correctly with torch.log, torch.exp etc on CPU. The exact same code works on CUDA.
Code example
>>> import torch
>>> x = torch.rand(1, 2)
>>> x
tensor([[0.1591, 0.0630]])
>>> y = x.expand(3, -1, -1)
>>> y
tensor([[[0.1591, 0.0630]],
[[0.1591, 0.0630]],
[[0.1591, 0.0630]]])
>>> torch.log(x)
tensor([[-1.8385, -2.7643]])
>>> torch.log(y)
tensor([[[ -1.8385, -2.7643]],
[[ nan, 67.2355]],
[[-103.2789, -inf]]])
>>> torch.exp(y)
tensor([[[1.1724, 1.0650]],
[[0.0000, inf]],
[[1.0000, 1.0000]]])System Info
PyTorch version: 0.4.1
Is debug build: No
CUDA used to build PyTorch: None
OS: Mac OSX 10.13.3
GCC version: Could not collect
CMake version: version 3.10.0
Python version: 3.6
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Versions of relevant libraries:
[pip] numpy (1.14.3)
[pip] torch (0.4.1)
[pip] torchvision (0.2.1)
[conda] pytorch 0.4.1 py36_cuda0.0_cudnn0.0_1 pytorch
[conda] torchvision 0.2.1 py36_1 pytorch
fritzo
Metadata
Metadata
Assignees
Labels
No labels