oneflow.isnan

oneflow.isnan()

Returns a new tensor with boolean elements representing if each element of input is NaN or not.

Parameters

input (Tensor) – the input tensor.

Returns

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

Example:

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