(a, b, *args, **kwargs)
| 125 | |
| 126 | |
| 127 | def torch_all_close(a, b, *args, **kwargs): |
| 128 | if not is_torch_available(): |
| 129 | raise ValueError("PyTorch needs to be installed to use this function.") |
| 130 | if not torch.allclose(a, b, *args, **kwargs): |
| 131 | assert False, f"Max diff is absolute {(a - b).abs().max()}. Diff tensor is {(a - b).abs()}." |
| 132 | return True |
| 133 | |
| 134 | |
| 135 | def assert_tensors_close( |
no test coverage detected
searching dependent graphs…