Skip to content

Commit

Permalink
add reshape function to Array class
Browse files Browse the repository at this point in the history
  • Loading branch information
haesleinhuepf committed Sep 29, 2024
1 parent 83af46d commit 68fa295
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pyclesperanto/_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
return NotImplemented


def reshape(self, shape):
"""Reshape the Array."""
return self.get().reshape(shape)


# missing operators:
# __array_interface__
# __array_ufunc__
Expand All @@ -288,6 +293,7 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
setattr(Array, "zeros", classmethod(zeros))
setattr(Array, "zeros_like", classmethod(zeros_like))
setattr(Array, "to_device", classmethod(to_device))
setattr(Array, "reshape", reshape)

# Add operations and class methods from _operators module
setattr(Array, "astype", _operators._astype)
Expand Down

0 comments on commit 68fa295

Please sign in to comment.