oneflow.isinf

oneflow.isinf(input)Tensor

This function is equivalent to PyTorch’s isinf function. The documentation is referenced from: https://pytorch.org/docs/1.10/generated/torch.isinf.html?highlight=isinf#torch.isinf

Tests if each element of input is infinite (positive or negative infinity) or not.

Parameters

input (Tensor) – the input tensor.

Returns

A boolean tensor that is True where input is infinite and False elsewhere.

Example:

>>> import oneflow as flow
>>> flow.isinf(flow.tensor([1, float('inf'), 2, float('-inf'), float('nan')]))
tensor([False,  True, False,  True, False], dtype=oneflow.bool)