not_equal

paddle.fluid.layers.not_equal(x, y, cond=None)[source]

This OP returns the truth value of \(x != y\) elementwise, which is equivalent function to the overloaded operator !=.

Parameters
  • x (Variable) – First input to compare which is N-D tensor. The input data type should be float32, float64, int32, int64.

  • y (Variable) – Second input to compare which is N-D tensor. The input data type should be float32, float64, int32, int64.

  • cond (Variable, optional) – Optional output which can be any created Variable that meets the requirements to store the result of not_equal. if cond is None, a new Varibale will be created to store the result.

Returns

The tensor variable storing the output, the output shape is same as input x.

Return type

Variable, the output data type is bool

Examples

import paddle.fluid as fluid

label = fluid.layers.data(name='label', shape=[1], dtype='int64')
limit = fluid.layers.fill_constant(shape=[1], value=1, dtype='int64')
out = fluid.layers.not_equal(x=label, y=limit)