MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / isfinite

Function isfinite

monai/transforms/utils_pytorch_numpy_unification.py:338–342  ·  view source on GitHub ↗

`np.isfinite` with equivalent implementation for torch.

(x: NdarrayOrTensor)

Source from the content-addressed store, hash-verified

336
337
338def 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
345def searchsorted(a: NdarrayTensor, v: NdarrayOrTensor, right=False, sorter=None, **kwargs) -> NdarrayTensor:

Callers 1

weighted_patch_samplesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…