Skip to content

Commit d213304

Browse files
committed
BUG: roll does not accept array shifts
1 parent 17c7c40 commit d213304

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

array_api_strict/_manipulation_functions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ def roll(
138138
139139
See its docstring for more information.
140140
"""
141+
if not isinstance(shift, int | tuple):
142+
raise ValueError(
143+
f"`shift` can only be an int or a tuple, got {type(shift)=} instead."
144+
)
141145
return Array._new(np.roll(x._array, shift, axis=axis), device=x.device)
142146

143147

0 commit comments

Comments
 (0)