pytorch
69d73345 - [Py3.10] Allow floats to be imported as Long (#81372)

Commit
3 years ago
[Py3.10] Allow floats to be imported as Long (#81372) Thus avoiding `TypeError: 'float' object cannot be interpreted as an integer` when trying to create integer tensor from floating point values Use `c10::checked_convert` to detect overflows during tensor construction from scalars. Modify sparse_csr test that violated this rule Fixes #69319 Tested in #81233 Pull Request resolved: https://github.com/pytorch/pytorch/pull/81372 Approved by: https://github.com/ezyang, https://github.com/ngimel
Author
Committer
Parents
Loading