Skip to content

Commit

Permalink
Merge pull request #243 from clEsperanto/reshape
Browse files Browse the repository at this point in the history
add reshape function to Array class
  • Loading branch information
StRigaud authored Sep 29, 2024
2 parents 83af46d + 68fa295 commit bfe5dff
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 bfe5dff

Please sign in to comment.