Skip to content

Commit 03df353

Browse files
committed
fix reshape
1 parent 5fbb04d commit 03df353

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • src/gradient_free_optimizers/_array_backend

src/gradient_free_optimizers/_array_backend/_pure.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,11 @@ def flatten(self):
589589
def ravel(self):
590590
return self.flatten()
591591

592-
def reshape(self, shape):
592+
def reshape(self, *args):
593+
if len(args) == 1:
594+
shape = args[0]
595+
else:
596+
shape = args
593597
if isinstance(shape, int):
594598
shape = (shape,)
595599
neg_idx = None
@@ -720,6 +724,12 @@ def argmin(self, axis=None):
720724
return best_i
721725
raise NotImplementedError("Axis-aware argmin not implemented")
722726

727+
def any(self):
728+
return _any(self._data)
729+
730+
def all(self):
731+
return _all(self._data)
732+
723733

724734
_eq = operator.eq
725735
_ne = operator.ne

0 commit comments

Comments
 (0)