Skip to content

Commit 0e4001a

Browse files
committed
MAINT: raise on dtype not None in ufuncs
1 parent ca7953c commit 0e4001a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

torch_np/_ufunc_impl.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def wrapped(x1, x2, /, out=None, *, where=True,
1616
if order != 'K' or not where:
1717
raise NotImplementedError
1818

19-
# XXX: dtype=... parameter is silently ignored
19+
# XXX: dtype=... parameter
20+
if dtype is not None:
21+
raise NotImplementedError
2022

2123
arrays = (x1, x2)
2224
tensors = _helpers.cast_and_broadcast(arrays, out, casting)
@@ -36,7 +38,9 @@ def wrapped(x1, /, out=None, *, where=True,
3638
if order != 'K' or not where:
3739
raise NotImplementedError
3840

39-
# XXX: dtype=... parameter is silently ignored
41+
# XXX: dtype=... parameter
42+
if dtype is not None:
43+
raise NotImplementedError
4044

4145
arrays = (x1, )
4246
tensors = _helpers.cast_and_broadcast(arrays, out, casting)

0 commit comments

Comments
 (0)