We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de68781 commit 0b4fcd9Copy full SHA for 0b4fcd9
array_api_compat/common/_aliases.py
@@ -331,7 +331,7 @@ def _asarray(
331
332
return xp.asarray(obj, dtype=dtype, **kwargs)
333
334
-# xp.reshape calls the keyword argument 'newshape' instead of 'shape'
+# np.reshape calls the keyword argument 'newshape' instead of 'shape'
335
def reshape(x: ndarray,
336
/,
337
shape: Tuple[int, ...],
@@ -340,8 +340,9 @@ def reshape(x: ndarray,
340
if copy is True:
341
x = x.copy()
342
elif copy is False:
343
- x.shape = shape
344
- return x
+ y = x.view()
+ y.shape = shape
345
+ return y
346
return xp.reshape(x, shape, **kwargs)
347
348
# The descending keyword is new in sort and argsort, and 'kind' replaced with
0 commit comments