(a, b, *args, **kwargs)
| 92 | |
| 93 | |
| 94 | def torch_all_close(a, b, *args, **kwargs): |
| 95 | if not is_torch_available(): |
| 96 | raise ValueError("PyTorch needs to be installed to use this function.") |
| 97 | if not torch.allclose(a, b, *args, **kwargs): |
| 98 | assert False, f"Max diff is absolute {(a - b).abs().max()}. Diff tensor is {(a - b).abs()}." |
| 99 | return True |
| 100 | |
| 101 | |
| 102 | def numpy_cosine_similarity_distance(a, b): |
no test coverage detected