-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Labels
API changeChanges to existing functions or objects in the API.Changes to existing functions or objects in the API.
Milestone
Description
numpy and PyTorch diverge on the zero division behavior of integral dtype
's:
>>> a1 = np.array(1, dtype=np.int)
>>> a2 = np.array(0, dtype=np.int)
>>> a1 // a2
0
>>> a1 % a2
0
>>> t1 = torch.tensor(1, dtype=torch.int)
>>> t2 = torch.tensor(0, dtype=torch.int)
>>> t1 // t2
RuntimeError: ZeroDivisionError
>>> t1 % t2
RuntimeError: ZeroDivisionError
We should either specify the behavior or fix the test suite to exclude zero as second input when testing these functions. cc @asmeurer
Metadata
Metadata
Assignees
Labels
API changeChanges to existing functions or objects in the API.Changes to existing functions or objects in the API.