Skip to content

repr of integer tensors with large values doesn't match construction #6811

@gchanan

Description

@gchanan

At least in python 3 (I didn't check python 2), literals in scientific notation are always floats.

So:

>>> a=torch.tensor(425245252)
>>> a.dtype
torch.int64
>>> a
tensor(4.2525e+08)
>>> torch.tensor(4.2525e+08).dtype
torch.float32

CC @li-roy

Metadata

Metadata

Assignees

Labels

module: printingIssues related to the printing format of tensors

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions