KEMBAR78
Relu() on integer Tensors gives incorrect results on macOS · Issue #15634 · pytorch/pytorch · GitHub
Skip to content

Relu() on integer Tensors gives incorrect results on macOS #15634

@suo

Description

@suo

Seems to only happen on macOS, not linux. Repro:

>>> import torch
>>> print(torch.__version__)
1.0.0.dev20181227
>>> x = (torch.randn(4,4) * 10).long()
>>> x
tensor([[  4,  -6,   7,  -2],
        [-10,  -2,  13,   0],
        [  1,  -4, -17,   3],
        [  4,   2, -10,  -9]])
>>> torch.relu(x)
tensor([[  0,  -6,   0,  -2],
        [-10,  -2,   0,   0],
        [  0,  -4, -17,   0],
        [  0,   0, -10,  -9]])

relu() works fine on 1d tensors but not 2d.

Initially reported here

Metadata

Metadata

Assignees

Labels

cherry-pickedThis PR was cherry-picked onto a release branch from masterhigh priority

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions