triton.testing.assert_close

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

断言两个输入在一定容差范围内是相近的。

参数:
  • x (标量, 列表, numpy.ndarray, 或 torch.Tensor) – 第一个输入。

  • y (标量, 列表, numpy.ndarray, 或 torch.Tensor) – 第二个输入。

  • atol (float, 可选) – 绝对容差。默认值为 1e-2。

  • rtol (float, 可选) – 相对容差。默认值为 0。

  • err_msg (str) – 断言失败时使用的错误消息。