KEMBAR78
Ambiguous description of torch.finfo.tiny · Issue #44010 · pytorch/pytorch · GitHub
Skip to content

Ambiguous description of torch.finfo.tiny #44010

@pomelyu

Description

@pomelyu

📚 Documentation

Hi

torch.finfo.tiny has the description

"The smallest positive representable number".

It's ambiguous, and not the actual smallest positive number. For example, torch.finfo("torch.float16").tiny get 6.10e-5, but the smallest positive representable number in FP16 should be 2^-24 or 5.96e-8. numpy.finfo.tiny also has this problem.

I check the code in TypeInfo.cpp, it uses std::numeric_limits<>::min() to get this value, but it should be std::numeric_limits<>::denorm_min() according the document.

I am not sure whether the tiny function should be modified or add new function, such as denorm_tiny, or just fix the description to be

"The minimum normalized positive number".

Thanks

cc @jlin27

Metadata

Metadata

Assignees

Labels

module: docsRelated to our documentation, both in docs/ and docblockstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions