triton.testing.assert_close

triton.testing.assert_close(x, y, atol=None, rtol=None, err_msg='')

Asserts that two inputs are close within a certain tolerance.

Parameters:
  • x (scala, list, numpy.ndarray, or torch.Tensor) – The first input.

  • y (scala, list, numpy.ndarray, or torch.Tensor) – The second input.

  • atol (float, optional) – The absolute tolerance. Default value is 1e-2.

  • rtol (float, optional) – The relative tolerance. Default value is 0.

  • err_msg (str) – The error message to use if the assertion fails.