Skip to content

Commit 2ba3411

Browse files
committed
Add reshape wrapper
1 parent abafd27 commit 2ba3411

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

numpy_array_api_compat/_aliases.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ def zeros_like(
268268
_check_device(device)
269269
return np.zeros_like(x, dtype=dtype)
270270

271+
# np.reshape calls the keyword argument 'newshape' instead of 'shape'
272+
def reshape(x: ndarray, /, shape: Tuple[int, ...]) -> ndarray:
273+
return np.reshape(x, shape)
274+
271275
# from numpy import * doesn't overwrite these builtin names
272276
from numpy import abs, max, min, round
273277

0 commit comments

Comments
 (0)