Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add copy keyword to dpnp.asarray and align dpnp.array(..., copy=None) with NumPy 2.0 #2006

Merged
merged 6 commits into from
Aug 21, 2024

Conversation

antonwolfy
Copy link
Contributor

@antonwolfy antonwolfy commented Aug 21, 2024

The copy keyword behavior changes in numpy.asarray and numpy.array during migration to NumPy 2.0 (see link for details).

The PR propose to align dpnp.array behavior with the changes done for numpy.asarray.
And also to add copy keyword to dpnp.asarray, which has been already present in dpctl.tensor interface for a time.

All the impacted tests are updated to cover any numpy version between 1.23 and 2.0.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you filing the PR as a draft?

@antonwolfy antonwolfy self-assigned this Aug 21, 2024
Copy link
Contributor

github-actions bot commented Aug 21, 2024

View rendered docs @ https://intelpython.github.io/dpnp/index.html

@antonwolfy antonwolfy marked this pull request as ready for review August 21, 2024 14:07
@antonwolfy antonwolfy force-pushed the align-copy-keyword-in-array-asarray-witn-numpy-2.0 branch from cbb7669 to 5dcf351 Compare August 21, 2024 14:14
Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com>
@antonwolfy antonwolfy merged commit 737d2b5 into master Aug 21, 2024
36 of 46 checks passed
@antonwolfy antonwolfy deleted the align-copy-keyword-in-array-asarray-witn-numpy-2.0 branch August 21, 2024 22:50
github-actions bot added a commit that referenced this pull request Aug 21, 2024
…None)` with NumPy 2.0 (#2006)

* Add copy keyword to dpnp.asarray() and align dpnp.array(..., copy=None) with NumPy 2.0

* Updated third party tests

* Pass copy=None to dpnp.array() from matmul implementation

* Update dpnp/dpnp_utils/dpnp_utils_linearalgebra.py

Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com>

---------

Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com> 737d2b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants