8000 BUG: Array API `reshape` does not conform to standard · Issue #23410 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
BUG: Array API reshape does not conform to standard #23410
Closed
@agoose77

Description

@agoose77

Describe the issue:

The reshape manipulation function in the new Array API takes a copy argument that we don't replicate in NumPy.

I think this is unintentional

Reproduce the code example:

import numpy.array_api as nx

array = nx.arange(10, dtype=nx.int64)
other = nx.reshape(array, (2, 5), copy=True)

array[:5] = -1
print(other)

Error message:

/tmp/test.py:1: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
  import numpy.array_api as nx
Traceback (most recent call last):
  File "/tmp/test.py", line 4, in <module>
    other = nx.reshape(array, (2, 5), copy=True)
TypeError: reshape() got an unexpected keyword argument 'copy'

Runtime information:

1.23.5
3.10.9 | packaged by conda-forge | (main, Feb  2 2023, 20:20:04) [GCC 11.3.0]

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0