TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.functional.isfinite

tensorplay.functional.isfinite(input) → Tensor[source]

Returns a new tensor with boolean elements representing if each element is finite or not.

Real values are finite when they are not NaN, negative infinity, or infinity. Complex values are finite when both their real and imaginary parts are finite.

Parameters:

input (Tensor) – the input tensor.

Returns:

A boolean tensor that is True where input is finite and False elsewhere

Example:

>>> tensorplay.isfinite(tensorplay.tensor([1, float('inf'), 2, float('-inf'), float('nan')]))
tensor([True,  False,  True,  False,  False])

On this page

Ask DeepWiki