Skip to content

[pytorch] Strange tensor printing behavior #9395

@vadimkantorov

Description

@vadimkantorov

Is there any reason the second tensor is printed as exactly zero?

Seems scientific notation is enabled for some cases, but gets disabled past some number (why 2e-5 is worse than 1e-5?)

Stumbled on this while examining some tensor which appeared to be all zeros, except in fact none of the elements were zero.

In [31]: torch.Tensor([1e-5])
Out[31]: tensor([1.0000e-05])

In [32]: torch.Tensor([2e-5])
Out[32]: tensor([0.0000])

at 0.5.0a0+8d38460

Metadata

Metadata

Assignees

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