|
|
|
@ -1408,8 +1408,9 @@ def less_than(x, y, force_cpu=None, cond=None):
|
|
|
|
|
x(${x_type}): ${x_comment}.
|
|
|
|
|
y(${y_type}): ${y_comment}.
|
|
|
|
|
force_cpu(${force_cpu_type}): ${force_cpu_comment}.
|
|
|
|
|
cond(Variable|None): Optional output variable to store the result of *less_than*
|
|
|
|
|
|
|
|
|
|
cond(Variable, optional): Optional output which can be any created Variable
|
|
|
|
|
that meets the requirements to store the result of *less_than*.
|
|
|
|
|
if cond is None, a new Varibale will be created to store the result.
|
|
|
|
|
Returns:
|
|
|
|
|
${out_comment}.
|
|
|
|
|
|
|
|
|
@ -1471,12 +1472,11 @@ def less_equal(x, y, cond=None):
|
|
|
|
|
Args:
|
|
|
|
|
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): If is :attr:`None`, the op will create a variable as output tensor, the input shape and data type of \
|
|
|
|
|
this tensor is the same as input :attr:`x`. If is not :attr:`None`, the op will set the variable as output tensor, the input shape \
|
|
|
|
|
and data type of this tensor should be the same as input :attr:`x`. Default value is :attr:`None`.
|
|
|
|
|
cond(Variable, optional): Optional output which can be any created Variable that meets the requirements to store the result of *less_equal*.
|
|
|
|
|
if cond is None, a new Varibale will be created to store the result.
|
|
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
Variable, the output data type is bool.: The tensor variable storing the output, the output shape is the same as input :attr:`x`.
|
|
|
|
|
Variable, the output data type is bool: The tensor variable storing the output, the output shape is same as input :attr:`x`.
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
.. code-block:: python
|
|
|
|
@ -1494,8 +1494,7 @@ def less_equal(x, y, cond=None):
|
|
|
|
|
check_variable_and_dtype(y, "y", ["float32", "float64", "int32", "int64"],
|
|
|
|
|
"less_equal")
|
|
|
|
|
if cond is not None:
|
|
|
|
|
check_variable_and_dtype(cond, "cond", [convert_dtype(x.dtype)],
|
|
|
|
|
"less_equal")
|
|
|
|
|
check_type(cond, "cond", Variable, "less_equal")
|
|
|
|
|
|
|
|
|
|
helper = LayerHelper("less_equal", **locals())
|
|
|
|
|
if cond is None:
|
|
|
|
@ -1521,12 +1520,11 @@ def greater_than(x, y, cond=None):
|
|
|
|
|
Args:
|
|
|
|
|
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): If is :attr:`None`, the op will create a variable as output tensor, the shape and data type of this \
|
|
|
|
|
tensor is the same as input :attr:`x` . If is not :attr:`None`, the op will set the variable as output tensor, the shape and data type \
|
|
|
|
|
of this tensor should be the same as input :attr:`x` . Default value is :attr:`None`.
|
|
|
|
|
cond(Variable, optional): Optional output which can be any created Variable that meets the requirements to store the result of *greater_than*.
|
|
|
|
|
if cond is None, a new Varibale will be created to store the result.
|
|
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
Variable, the output data type is bool.: The tensor variable storing the output, the output shape is the same as input :attr:`x` .
|
|
|
|
|
Variable, the output data type is bool: The tensor variable storing the output, the output shape is same as input :attr:`x` .
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
.. code-block:: python
|
|
|
|
@ -1543,8 +1541,7 @@ def greater_than(x, y, cond=None):
|
|
|
|
|
check_variable_and_dtype(y, "y", ["float32", "float64", "int32", "int64"],
|
|
|
|
|
"greater_than")
|
|
|
|
|
if cond is not None:
|
|
|
|
|
check_variable_and_dtype(cond, "cond", [convert_dtype(x.dtype)],
|
|
|
|
|
"greater_than")
|
|
|
|
|
check_type(cond, "cond", Variable, "greater_than")
|
|
|
|
|
|
|
|
|
|
helper = LayerHelper("greater_than", **locals())
|
|
|
|
|
if cond is None:
|
|
|
|
@ -1570,12 +1567,11 @@ def greater_equal(x, y, cond=None):
|
|
|
|
|
Args:
|
|
|
|
|
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): If is :attr:`None` , the op will create a variable as output tensor, the shape and data type of this \
|
|
|
|
|
tensor is the same as input :attr:`x`. If is not :attr:`None` , the op will set the variable as output tensor, the shape and data \
|
|
|
|
|
type of this tensor is the same as input :attr:`x`. Default value is :attr:`None`.
|
|
|
|
|
cond(Variable, optional): Optional output which can be any created Variable that meets the requirements to store the result of *greater_equal*.
|
|
|
|
|
if cond is None, a new Varibale will be created to store the result.
|
|
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
Variable, the output data type is bool.: The tensor variable storing the output, the output shape is the same as input :attr:`x`.
|
|
|
|
|
Variable, the output data type is bool: The tensor variable storing the output, the output shape is same as input :attr:`x`.
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
.. code-block:: python
|
|
|
|
@ -1594,8 +1590,7 @@ def greater_equal(x, y, cond=None):
|
|
|
|
|
check_variable_and_dtype(y, "y", ["float32", "float64", "int32", "int64"],
|
|
|
|
|
"greater_equal")
|
|
|
|
|
if cond is not None:
|
|
|
|
|
check_variable_and_dtype(cond, "cond", [convert_dtype(x.dtype)],
|
|
|
|
|
"greater_equal")
|
|
|
|
|
check_type(cond, "cond", Variable, "greater_equal")
|
|
|
|
|
|
|
|
|
|
helper = LayerHelper("greater_equal", **locals())
|
|
|
|
|
if cond is None:
|
|
|
|
@ -1645,8 +1640,7 @@ def equal(x, y, cond=None):
|
|
|
|
|
check_variable_and_dtype(y, "y", ["float32", "float64", "int32", "int64"],
|
|
|
|
|
"equal")
|
|
|
|
|
if cond is not None:
|
|
|
|
|
check_variable_and_dtype(cond, "cond", [convert_dtype(x.dtype)],
|
|
|
|
|
"equal")
|
|
|
|
|
check_type(cond, "cond", Variable, "equal")
|
|
|
|
|
|
|
|
|
|
helper = LayerHelper("equal", **locals())
|
|
|
|
|
if cond is None:
|
|
|
|
@ -1666,12 +1660,11 @@ def not_equal(x, y, cond=None):
|
|
|
|
|
Args:
|
|
|
|
|
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): If is :attr:`None`, the op will create a variable as output tensor, the shape and data type of this \
|
|
|
|
|
tensor is the same as input :attr:`x`. If is not :attr:`None`, the op will set the variable as output tensor, the shape and data \
|
|
|
|
|
type of this tensor should be the same as input :attr:`x`. Default value is :attr:`None`.
|
|
|
|
|
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:
|
|
|
|
|
Variable, the output data type is bool.: The tensor variable storing the output, the output shape is the same as input :attr:`x`.
|
|
|
|
|
Variable, the output data type is bool: The tensor variable storing the output, the output shape is same as input :attr:`x`.
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
.. code-block:: python
|
|
|
|
@ -1687,8 +1680,7 @@ def not_equal(x, y, cond=None):
|
|
|
|
|
check_variable_and_dtype(y, "y", ["float32", "float64", "int32", "int64"],
|
|
|
|
|
"not_equal")
|
|
|
|
|
if cond is not None:
|
|
|
|
|
check_variable_and_dtype(cond, "cond", [convert_dtype(x.dtype)],
|
|
|
|
|
"not_equal")
|
|
|
|
|
check_type(cond, "cond", Variable, "not_equal")
|
|
|
|
|
|
|
|
|
|
helper = LayerHelper("not_equal", **locals())
|
|
|
|
|
if cond is None:
|
|
|
|
|