mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-05 03:01:17 -04:00
[TESTING] triton.testing.allclose now uses torch.allclose (#1333)
This commit is contained in:
@@ -106,10 +106,8 @@ def allclose(x, y, atol=0, rtol=1e-2):
|
||||
return torch.sum(x ^ y) == 0
|
||||
if x.dtype in [torch.int8, torch.int16, torch.int32, torch.int64]:
|
||||
rtol = 0
|
||||
diff = abs(x - y)
|
||||
x_max = torch.max(x)
|
||||
y_max = torch.max(y)
|
||||
return torch.max(diff) <= atol + rtol * torch.max(x_max, y_max)
|
||||
atol = 0
|
||||
return torch.allclose(x, y, rtol=rtol, atol=atol)
|
||||
|
||||
|
||||
def nvsmi(attrs):
|
||||
|
||||
Reference in New Issue
Block a user