(result)
| 174 | |
| 175 | |
| 176 | def _has_infs(result) -> bool: |
| 177 | if isinstance(result, np.ndarray): |
| 178 | if result.dtype in ("f8", "f4"): |
| 179 | # Note: outside of a nanops-specific test, we always have |
| 180 | # result.ndim == 1, so there is no risk of this ravel making a copy. |
| 181 | return lib.has_infs(result.ravel("K")) |
| 182 | try: |
| 183 | return np.isinf(result).any() |
| 184 | except (TypeError, NotImplementedError): |
| 185 | # if it doesn't support infs, then it can't have infs |
| 186 | return False |
| 187 | |
| 188 | |
| 189 | def _get_fill_value( |