(x: DType)
| 150 | @staticmethod |
| 151 | @functools.cache |
| 152 | def is_float(x: DType) -> bool: return x.scalar() in dtypes.floats or isinstance(x, ImageDType) |
| 153 | @staticmethod # static methods on top, or bool in the type info will refer to dtypes.bool |
| 154 | @functools.cache |
| 155 | def is_int(x: DType) -> bool: return x.scalar() in (dtypes.ints + (dtypes.weakint,)) |