latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.allclose
- tensorplay.functional.allclose(input: Tensor, other: Tensor, rtol: float = 1e-05, atol: float = 1e-08, equal_nan: bool = False) bool[source]
This function checks if
inputandothersatisfy the condition:elementwise, for all elements of
inputandother. The behaviour of this function is analogous to numpy.allclose- Parameters:
Example:
>>> tensorplay.allclose(tensorplay.tensor([10000., 1e-07]), tensorplay.tensor([10000.1, 1e-08])) False >>> tensorplay.allclose(tensorplay.tensor([10000., 1e-08]), tensorplay.tensor([10000.1, 1e-09])) True >>> tensorplay.allclose(tensorplay.tensor([1.0, float('nan')]), tensorplay.tensor([1.0, float('nan')])) False >>> tensorplay.allclose(tensorplay.tensor([1.0, float('nan')]), tensorplay.tensor([1.0, float('nan')]), equal_nan=True) True
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

