From 23eb73c9616a44cc40fe6db294c8ba988fd5c7a4 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Thu, 12 Aug 2021 10:10:37 -0500 Subject: [PATCH] Add pt.Array.(any|all) --- pytato/array.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pytato/array.py b/pytato/array.py index c546d2f..25ffc52 100644 --- a/pytato/array.py +++ b/pytato/array.py @@ -354,6 +354,8 @@ class Array(Taggable): .. method:: __rxor__ .. method:: __abs__ .. method:: conj + .. automethod:: all + .. automethod:: any .. autoattribute:: real .. autoattribute:: imag @@ -611,6 +613,20 @@ class Array(Taggable): # expected "Union[int, Sequence[int]]" return pt.reshape(self, shape, order=order) # type: ignore + def all(self, axis: int = 0) -> ArrayOrScalar: + """ + Equivalent to :func:`pytato.all`. + """ + import pytato as pt + return pt.all(self, axis) + + def any(self, axis: int = 0) -> ArrayOrScalar: + """ + Equivalent to :func:`pytato.any`. + """ + import pytato as pt + return pt.any(self, axis) + # }}} -- GitLab