_check_nan
check_nan
¶
Checks if the input contains NaN values.
This method can be used with Numpy data:
n = np.array([[[1.0, 2.0], [3.0, np.NaN]], [[5.0, 6.0], [7.0, 8.0]]])
b = fe.backend.check_nan(n) # True
This method can be used with TensorFlow tensors:
t = tf.constant([[[1.0, 2.0], [3.0, 4.0]], [[np.NaN, 6.0], [7.0, 8.0]]])
b = fe.backend.check_nan(n) # True
This method can be used with PyTorch tensors:
p = torch.tensor([[[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [np.NaN, 8.0]]])
b = fe.backend.check_nan(n) # True
Parameters:
Name | Type | Description | Default |
---|---|---|---|
val |
Union[int, float, ndarray, Tensor, Tensor]
|
The input value. |
required |
Returns:
Type | Description |
---|---|
bool
|
True iff |