_getlimits.py 269 B

123456789101112131415
  1. # mypy: ignore-errors
  2. import torch
  3. from . import _dtypes
  4. def finfo(dtyp):
  5. torch_dtype = _dtypes.dtype(dtyp).torch_dtype
  6. return torch.finfo(torch_dtype)
  7. def iinfo(dtyp):
  8. torch_dtype = _dtypes.dtype(dtyp).torch_dtype
  9. return torch.iinfo(torch_dtype)