(dtype)
| 22 | |
| 23 | |
| 24 | def _get_max_identity(dtype) -> np.ndarray: |
| 25 | if dtype == np.float32 or dtype == np.float64 or dtype == np.float16: |
| 26 | return np.array(-np.inf, dtype) |
| 27 | elif ( |
| 28 | dtype == np.int32 or dtype == np.int64 or dtype == np.int16 or dtype == np.int8 |
| 29 | ): |
| 30 | return np.array(np.iinfo(dtype).min, dtype) |
| 31 | else: |
| 32 | assert False, f"unsupported dtype for max: {dtype}" |
| 33 | |
| 34 | |
| 35 | def _get_min_identity(dtype) -> np.ndarray: |
no test coverage detected