Skip to content

Commit 72a7c9b

Browse files
Update bitwise docs adding broadcast info
1 parent 488bdb5 commit 72a7c9b

File tree

1 file changed

+28
-21
lines changed

1 file changed

+28
-21
lines changed

dpnp/dpnp_iface_bitwise.py

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ def binary_repr(num, width=None):
134134
135135
Parameters
136136
----------
137-
x1 : {dpnp.ndarray, usm_ndarray, scalar}
138-
First input array, expected to have integer or boolean data type.
137+
x1, x2 : {dpnp.ndarray, usm_ndarray, scalar}
138+
Input arrays, expected to have integer or boolean data type.
139139
Both inputs `x1` and `x2` can not be scalars at the same time.
140-
x2 : {dpnp.ndarray, usm_ndarray, scalar}
141-
Second input array, also expected to have integer or boolean data
142-
type. Both inputs `x1` and `x2` can not be scalars at the same time.
140+
If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
141+
(which becomes the shape of the output).
143142
out : {None, dpnp.ndarray, usm_ndarray}, optional
144143
Output array to populate.
145-
Array must have the correct shape and the expected data type.
144+
Array must have a shape that the inputs broadcast to and
145+
the expected data type.
146146
Default: ``None``.
147147
order : {"C", "F", "A", "K"}, optional
148148
Memory layout of the newly output array, if parameter `out` is ``None``.
@@ -218,15 +218,15 @@ def binary_repr(num, width=None):
218218
219219
Parameters
220220
----------
221-
x1 : {dpnp.ndarray, usm_ndarray, scalar}
222-
First input array, expected to have integer or boolean data type.
221+
x1, x2 : {dpnp.ndarray, usm_ndarray, scalar}
222+
Input arrays, expected to have integer or boolean data type.
223223
Both inputs `x1` and `x2` can not be scalars at the same time.
224-
x2 : {dpnp.ndarray, usm_ndarray, scalar}
225-
Second input array, also expected to have integer or boolean data
226-
type. Both inputs `x1` and `x2` can not be scalars at the same time.
224+
If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
225+
(which becomes the shape of the output).
227226
out : {None, dpnp.ndarray, usm_ndarray}, optional
228227
Output array to populate.
229-
Array must have the correct shape and the expected data type.
228+
Array must have a shape that the inputs broadcast to and
229+
the expected data type.
230230
Default: ``None``.
231231
order : {"C", "F", "A", "K"}, optional
232232
Memory layout of the newly output array, if parameter `out` is ``None``.
@@ -293,15 +293,15 @@ def binary_repr(num, width=None):
293293
294294
Parameters
295295
----------
296-
x1 : {dpnp.ndarray, usm_ndarray, scalar}
297-
First input array, expected to have integer or boolean data type.
296+
x1, x2 : {dpnp.ndarray, usm_ndarray, scalar}
297+
Input arrays, expected to have integer or boolean data type.
298298
Both inputs `x1` and `x2` can not be scalars at the same time.
299-
x2 : {dpnp.ndarray, usm_ndarray, scalar}
300-
Second input array, also expected to have integer or boolean data
301-
type. Both inputs `x1` and `x2` can not be scalars at the same time.
299+
If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
300+
(which becomes the shape of the output).
302301
out : {None, dpnp.ndarray, usm_ndarray}, optional
303302
Output array to populate.
304-
Array must have the correct shape and the expected data type.
303+
Array must have a shape that the inputs broadcast to and
304+
the expected data type.
305305
Default: ``None``.
306306
order : {"C", "F", "A", "K"}, optional
307307
Memory layout of the newly output array, if parameter `out` is ``None``.
@@ -376,7 +376,8 @@ def binary_repr(num, width=None):
376376
Input array, expected to have integer or boolean data type.
377377
out : {None, dpnp.ndarray, usm_ndarray}, optional
378378
Output array to populate.
379-
Array must have the correct shape and the expected data type.
379+
Array must have a shape that the input broadcast to and
380+
the expected data type.
380381
Default: ``None``.
381382
order : {"C", "F", "A", "K"}, optional
382383
Memory layout of the newly output array, if parameter `out` is ``None``.
@@ -458,9 +459,12 @@ def binary_repr(num, width=None):
458459
Second input array, also expected to have integer data type.
459460
Each element must be greater than or equal to ``0``.
460461
Both inputs `x1` and `x2` can not be scalars at the same time.
462+
If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
463+
(which becomes the shape of the output).
461464
out : {None, dpnp.ndarray, usm_ndarray}, optional
462465
Output array to populate.
463-
Array must have the correct shape and the expected data type.
466+
Array must have a shape that the inputs broadcast to and
467+
the expected data type.
464468
Default: ``None``.
465469
order : {"C", "F", "A", "K"}, optional
466470
Memory layout of the newly output array, if parameter `out` is ``None``.
@@ -532,9 +536,12 @@ def binary_repr(num, width=None):
532536
Second input array, also expected to have integer data type.
533537
Each element must be greater than or equal to ``0``.
534538
Both inputs `x1` and `x2` can not be scalars at the same time.
539+
If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
540+
(which becomes the shape of the output).
535541
out : {None, dpnp.ndarray, usm_ndarray}, optional
536542
Output array to populate.
537-
Array must have the correct shape and the expected data type.
543+
Array must have a shape that the inputs broadcast to and
544+
the expected data type.
538545
Default: ``None``.
539546
order : {"C", "F", "A", "K"}, optional
540547
Memory layout of the newly output array, if parameter `out` is ``None``.

0 commit comments

Comments
 (0)