@@ -39,7 +39,7 @@ def argmax(data, axis=None, keepdims=False, exclude=False):
3939
4040 exclude : bool
4141 If `exclude` is true, reduction will be performed on the axes that are
42- NOT in axis instead.
42+ NOT in axis instead.
4343
4444 Returns
4545 -------
@@ -69,7 +69,7 @@ def argmin(data, axis=None, keepdims=False, exclude=False):
6969
7070 exclude : bool
7171 If `exclude` is true, reduction will be performed on the axes that are
72- NOT in axis instead.
72+ NOT in axis instead.
7373
7474 Returns
7575 -------
@@ -100,7 +100,7 @@ def sum(data, axis=None, keepdims=False, exclude=False):
100100
101101 exclude : bool
102102 If `exclude` is true, reduction will be performed on the axes that are
103- NOT in axis instead.
103+ NOT in axis instead.
104104
105105 Returns
106106 -------
@@ -112,12 +112,12 @@ def sum(data, axis=None, keepdims=False, exclude=False):
112112
113113
114114def all (data , axis = None , keepdims = False , exclude = False ):
115- """Computes the logical and of array elements over given axes.
115+ """Computes the logical AND of boolean array elements over given axes.
116116
117117 Parameters
118118 ----------
119119 data : relay.Expr
120- The input data
120+ The input boolean tensor
121121
122122 axis : None or int or tuple of int
123123 Axis or axes along which a sum is performed. The default, axis=None,
@@ -131,12 +131,33 @@ def all(data, axis=None, keepdims=False, exclude=False):
131131
132132 exclude : bool
133133 If `exclude` is true, reduction will be performed on the axes that are
134- NOT in axis instead.
134+ NOT in axis instead.
135135
136136 Returns
137137 -------
138138 result : relay.Expr
139139 The computed result.
140+
141+ Examples
142+ --------
143+ .. code-block:: python
144+
145+ data = relay.Constant(tvm.nd.array([[[ True, True, True],
146+ [ True, True, True],
147+ [False, True, False]],
148+ [[ True, False, False],
149+ [ True, True, False],
150+ [False, True, True]]]))
151+
152+ relay.all(data, axis=1)
153+ # [[False, True, False],
154+ # [False, False, False]]
155+
156+ relay.all(data, axis=0)
157+ # [[ True, False, False],
158+ # [ True, True, False],
159+ # [False, True, False]]
160+
140161 """
141162 axis = [axis ] if axis and isinstance (axis , int ) else axis
142163 return _make .all (data , axis , keepdims , exclude )
@@ -162,7 +183,7 @@ def max(data, axis=None, keepdims=False, exclude=False):
162183
163184 exclude : bool
164185 If `exclude` is true, reduction will be performed on the axes that are
165- NOT in axis instead.
186+ NOT in axis instead.
166187
167188 Returns
168189 -------
@@ -194,7 +215,7 @@ def min(data, axis=None, keepdims=False, exclude=False):
194215
195216 exclude : bool
196217 If `exclude` is true, reduction will be performed on the axes that are
197- NOT in axis instead.
218+ NOT in axis instead.
198219
199220 Returns
200221 -------
@@ -225,7 +246,7 @@ def mean(data, axis=None, keepdims=False, exclude=False):
225246
226247 exclude : bool
227248 If `exclude` is true, reduction will be performed on the axes that are
228- NOT in axis instead.
249+ NOT in axis instead.
229250
230251 Returns
231252 -------
@@ -256,7 +277,7 @@ def prod(data, axis=None, keepdims=False, exclude=False):
256277
257278 exclude : bool
258279 If `exclude` is true, reduction will be performed on the axes that are
259- NOT in axis instead.
280+ NOT in axis instead.
260281
261282 Returns
262283 -------
0 commit comments