Simplified the logic of reverse.
@@ -572,11 +572,9 @@ def transpose(x):
def reverse(x, axes):
- if isinstance(axes, int):
- axes = [axes]
- for a in axes:
- x = np.flip(x, a)
- return x
+ if isinstance(axes, list):
+ axes = tuple(axes)
+ return np.flip(x, axes)
def variable(value, dtype=None, name=None, constraint=None):
