mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-06 17:24:59 +08:00
[1/N] Add strict parameter to Python zip calls (#165531)
Add `strict=True/False` to zip calls in test utils. `strict=True` is passed when possible. Pull Request resolved: https://github.com/pytorch/pytorch/pull/165531 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
0f0b4bf029
commit
aaac8cb0f5
@ -92,7 +92,9 @@ def default_tolerances(
|
||||
f"Expected a torch.Tensor or a torch.dtype, but got {type(input)} instead."
|
||||
)
|
||||
dtype_precisions = dtype_precisions or _DTYPE_PRECISIONS
|
||||
rtols, atols = zip(*[dtype_precisions.get(dtype, (0.0, 0.0)) for dtype in dtypes])
|
||||
rtols, atols = zip(
|
||||
*[dtype_precisions.get(dtype, (0.0, 0.0)) for dtype in dtypes], strict=True
|
||||
)
|
||||
return max(rtols), max(atols)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user