`np.isfinite` with equivalent implementation for torch.
(x: NdarrayOrTensor)
| 336 | |
| 337 | |
| 338 | def isfinite(x: NdarrayOrTensor) -> NdarrayOrTensor: |
| 339 | """`np.isfinite` with equivalent implementation for torch.""" |
| 340 | if not isinstance(x, torch.Tensor): |
| 341 | return np.isfinite(x) # type: ignore |
| 342 | return torch.isfinite(x) |
| 343 | |
| 344 | |
| 345 | def searchsorted(a: NdarrayTensor, v: NdarrayOrTensor, right=False, sorter=None, **kwargs) -> NdarrayTensor: |
no outgoing calls
no test coverage detected
searching dependent graphs…