From d213304dc8356e3b7dcbcf7a959edb2b4863c81d Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Thu, 8 May 2025 20:05:03 +0200 Subject: [PATCH] BUG: roll does not accept array shifts --- array_api_strict/_manipulation_functions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/array_api_strict/_manipulation_functions.py b/array_api_strict/_manipulation_functions.py index fe4a608..7c4adda 100644 --- a/array_api_strict/_manipulation_functions.py +++ b/array_api_strict/_manipulation_functions.py @@ -138,6 +138,10 @@ def roll( See its docstring for more information. """ + if not isinstance(shift, int | tuple): + raise ValueError( + f"`shift` can only be an int or a tuple, got {type(shift)=} instead." + ) return Array._new(np.roll(x._array, shift, axis=axis), device=x.device)