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.

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