isclose
- paddle. isclose ( x: Tensor, y: Tensor, rtol: float = 1e-05, atol: float = 1e-08, equal_nan: bool = False, name: str | None = None ) Tensor [source]
-
Check if all \(x\) and \(y\) satisfy the condition: .. math:
\left| x - y
ight| leq atol + rtol imes left| y ight|
elementwise, for all elements of \(x\) and \(y\). The behaviour of this operator is analogous to \(numpy.isclose\), namely that it returns \(True\) if two tensors are elementwise equal within a tolerance. Args:
x(Tensor): The input tensor, it’s data type should be float16, float32, float64, complex64, complex128. y(Tensor): The input tensor, it’s data type should be float16, float32, float64, complex64, complex128. rtol(float, optional): The relative tolerance. Default: \(1e-5\) . atol(float, optional): The absolute tolerance. Default: \(1e-8\) . equal_nan(bool, optional): If \(True\) , then two \(NaNs\) will be compared as equal. Default: \(False\) . name (str|None, optional): Name for the operation. For more information, please
refer to api_guide_Name. Default: None.
- Returns:
-
Tensor: The output tensor, it’s data type is bool.
- Examples:
