Skip to content

Commit 81cd2a4

Browse files
committed
Implement dpnp.ndarray.__bytes__() method
1 parent a408c2a commit 81cd2a4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dpnp/dpnp_array.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ def __bool__(self, /):
185185
"""``True`` if `self` else ``False``."""
186186
return self._array_obj.__bool__()
187187

188+
def __bytes__(self):
189+
r"""Return :math:`\text{bytes(self)}`."""
190+
return bytes(self.asnumpy())
191+
188192
# '__class__',
189193
# `__class_getitem__`,
190194

0 commit comments

Comments
 (0)