Skip to content

Creating tensors from numpy arrays with ">f" type yields bogus results #3671

@ejoebstl

Description

@ejoebstl
y = np.array([[1., 2., 3.],
             [4., 5., 6.]], dtype=">f")
torch.from_numpy(y)

Gives

1.00000e-41 *
  4.6006  0.0090  2.3049
  4.6007  5.7487  6.8966
[torch.FloatTensor of size 2x3]

Which is clearly incorrect.

Such types are common when using np.from_file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions