has_inf

paddle.fluid.layers.has_inf(x)[source]

Test if any of x contains an infinity number

Parameters

x (Variable) – The Tensor/LoDTensor to be checked.

Returns

The tensor variable storing the output, only a bool value, indicating that whether there is infinity number in x or not.

Return type

Variable

Examples

import paddle.fluid as fluid
data = fluid.layers.data(name="input", shape=[4, 32, 32], dtype="float32")
res = fluid.layers.has_inf(data)