Skip to content

Commit

Permalink
Implement ndarray.__array__ interface method
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy committed Jan 14, 2025
1 parent 44bb068 commit 0ae85c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dpnp/dpnp_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@ def __and__(self, other):
"""Return ``self&value``."""
return dpnp.bitwise_and(self, other)

# '__array__',
def __array__(self, dtype=None, /, *, copy=None):
raise TypeError(
"Implicit conversion to a NumPy array is not allowed. "
"Please use `.asnumpy()` to construct a NumPy array explicitly."
)

# '__array_finalize__',
# '__array_function__',
# '__array_interface__',
Expand Down

0 comments on commit 0ae85c3

Please sign in to comment.