Skip to content

Deprecation warning with shapes in latest numpy #3025

Description

@david-cortes-intel

I see this warning when using DPNP with the latest version of NumPy:

pixi/envs/examples-gpu/lib/python3.12/site-packages/dpnp/dpnp_array.py", line 199, in __bool__
    return self._array_obj.__bool__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "dpnp/tensor/_usmarray.pyx", line 1154, in dpnp.tensor._usmarray.usm_ndarray.__bool__
  File "dpnp/tensor/_usmarray.pyx", line 133, in dpnp.tensor._usmarray._as_zero_dim_ndarray
DeprecationWarning: Setting the shape on a NumPy array has been deprecated in NumPy 2.5.
As an alternative, you can create a new view using np.reshape (with copy=False if needed).

Not sure how exactly to trigger it. Error started popping up quite recently in CI jobs from sklearnex.

Activity

  1. antonwolfy commented on Aug 13, 2026

    @antonwolfy
    Contributor

    @david-cortes-intel, thank you for submitting the issue.

    It should be already resolved by #2958 and will be included in 0.21.0 release.

  2. self-assigned this
    on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions