Skip to content

[PyTorch] Don't use scientific notation for printing integer tensors #6865

@colesbury

Description

@colesbury

We currently use scientific notation (E-notation) to print large integer tensors. We shouldn't do this because it hides meaningful digits and because E-notation corresponds to floating point data types in Python.

>>> x = torch.ones(525076, dtype=torch.int)
>>> x.sum()
tensor(5.2508e+05)
>>> x.sum().item()
525076

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions