@@ -130,21 +130,17 @@ def binary_repr(num, width=None):
130
130
131
131
_BITWISE_AND_DOCSTRING = """
132
132
Computes the bitwise AND of the underlying binary representation of each
133
- element `x1_i` of the input array `x1` with the respective element `x2_i`
134
- of the input array `x2`.
133
+ element :math: `x1_i` of the input array `x1` with the respective element
134
+ :math:`x2_i` of the input array `x2`.
135
135
136
136
For full documentation refer to :obj:`numpy.bitwise_and`.
137
137
138
138
Parameters
139
139
----------
140
140
x1 : {dpnp.ndarray, usm_ndarray, scalar}
141
- First input array, expected to have integer or boolean data type.
142
- Both inputs `x1` and `x2` can not be scalars at the same time.
141
+ First input array, expected to have an integer or boolean data type.
143
142
x2 : {dpnp.ndarray, usm_ndarray, scalar}
144
- Second input array, also expected to have integer or boolean data
145
- type. Both inputs `x1` and `x2` can not be scalars at the same time.
146
- If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
147
- (which becomes the shape of the output).
143
+ Second input array, also expected to have an integer or boolean data type.
148
144
out : {None, dpnp.ndarray, usm_ndarray}, optional
149
145
Output array to populate.
150
146
Array must have the correct shape and the expected data type.
@@ -175,6 +171,13 @@ def binary_repr(num, width=None):
175
171
:obj:`dpnp.binary_repr` : Return the binary representation of the input number
176
172
as a string.
177
173
174
+ Notes
175
+ -----
176
+ At least one of `x1` or `x2` must be an array.
177
+
178
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
179
+ (which becomes the shape of the output).
180
+
178
181
Examples
179
182
--------
180
183
>>> import dpnp as np
@@ -206,6 +209,7 @@ def binary_repr(num, width=None):
206
209
'1100'
207
210
>>> np.bitwise_and(np.array([14, 3]), 13)
208
211
array([12, 1])
212
+
209
213
"""
210
214
211
215
bitwise_and = DPNPBinaryFunc (
@@ -225,7 +229,7 @@ def binary_repr(num, width=None):
225
229
Parameters
226
230
----------
227
231
x : {dpnp.ndarray, usm_ndarray}
228
- Input array, expected to have integer or boolean data type.
232
+ Input array, expected to have an integer data type.
229
233
out : {None, dpnp.ndarray, usm_ndarray}, optional
230
234
Output array to populate.
231
235
Array must have the correct shape and the expected data type.
@@ -272,21 +276,17 @@ def binary_repr(num, width=None):
272
276
273
277
_BITWISE_OR_DOCSTRING = """
274
278
Computes the bitwise OR of the underlying binary representation of each
275
- element `x1_i` of the input array `x1` with the respective element `x2_i`
276
- of the input array `x2`.
279
+ element :math: `x1_i` of the input array `x1` with the respective element
280
+ :math:`x2_i` of the input array `x2`.
277
281
278
282
For full documentation refer to :obj:`numpy.bitwise_or`.
279
283
280
284
Parameters
281
285
----------
282
286
x1 : {dpnp.ndarray, usm_ndarray, scalar}
283
- First input array, expected to have integer or boolean data type.
284
- Both inputs `x1` and `x2` can not be scalars at the same time.
287
+ First input array, expected to have an integer or boolean data type.
285
288
x2 : {dpnp.ndarray, usm_ndarray, scalar}
286
- Second input array, also expected to have integer or boolean data
287
- type. Both inputs `x1` and `x2` can not be scalars at the same time.
288
- If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
289
- (which becomes the shape of the output).
289
+ Second input array, also expected to have an integer or boolean data type.
290
290
out : {None, dpnp.ndarray, usm_ndarray}, optional
291
291
Output array to populate.
292
292
Array must have the correct shape and the expected data type.
@@ -317,6 +317,13 @@ def binary_repr(num, width=None):
317
317
:obj:`dpnp.binary_repr` : Return the binary representation of the input number
318
318
as a string.
319
319
320
+ Notes
321
+ -----
322
+ At least one of `x1` or `x2` must be an array.
323
+
324
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
325
+ (which becomes the shape of the output).
326
+
320
327
Examples
321
328
--------
322
329
>>> import dpnp as np
@@ -339,6 +346,7 @@ def binary_repr(num, width=None):
339
346
array(29)
340
347
>>> np.binary_repr(29)
341
348
'11101'
349
+
342
350
"""
343
351
344
352
bitwise_or = DPNPBinaryFunc (
@@ -352,21 +360,17 @@ def binary_repr(num, width=None):
352
360
353
361
_BITWISE_XOR_DOCSTRING = """
354
362
Computes the bitwise XOR of the underlying binary representation of each
355
- element `x1_i` of the input array `x1` with the respective element `x2_i`
356
- of the input array `x2`.
363
+ element :math: `x1_i` of the input array `x1` with the respective element
364
+ :math:`x2_i` of the input array `x2`.
357
365
358
366
For full documentation refer to :obj:`numpy.bitwise_xor`.
359
367
360
368
Parameters
361
369
----------
362
370
x1 : {dpnp.ndarray, usm_ndarray, scalar}
363
- First input array, expected to have integer or boolean data type.
364
- Both inputs `x1` and `x2` can not be scalars at the same time.
371
+ First input array, expected to have an integer or boolean data type.
365
372
x2 : {dpnp.ndarray, usm_ndarray, scalar}
366
- Second input array, also expected to have integer or boolean data
367
- type. Both inputs `x1` and `x2` can not be scalars at the same time.
368
- If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
369
- (which becomes the shape of the output).
373
+ Second input array, also expected to have an integer or boolean data type.
370
374
out : {None, dpnp.ndarray, usm_ndarray}, optional
371
375
Output array to populate.
372
376
Array must have the correct shape and the expected data type.
@@ -397,6 +401,13 @@ def binary_repr(num, width=None):
397
401
:obj:`dpnp.binary_repr` : Return the binary representation of the input number
398
402
as a string.
399
403
404
+ Notes
405
+ -----
406
+ At least one of `x1` or `x2` must be an array.
407
+
408
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
409
+ (which becomes the shape of the output).
410
+
400
411
Examples
401
412
--------
402
413
>>> import dpnp as np
@@ -423,6 +434,7 @@ def binary_repr(num, width=None):
423
434
array(28)
424
435
>>> np.binary_repr(28)
425
436
'11100'
437
+
426
438
"""
427
439
428
440
bitwise_xor = DPNPBinaryFunc (
@@ -435,7 +447,7 @@ def binary_repr(num, width=None):
435
447
436
448
437
449
_INVERT_DOCSTRING = """
438
- Inverts (flips) each bit for each element `x_i` of the input array `x`.
450
+ Inverts (flips) each bit for each element :math: `x_i` of the input array `x`.
439
451
440
452
Note that :obj:`dpnp.bitwise_invert` is an alias of :obj:`dpnp.invert`.
441
453
@@ -444,7 +456,7 @@ def binary_repr(num, width=None):
444
456
Parameters
445
457
----------
446
458
x : {dpnp.ndarray, usm_ndarray}
447
- Input array, expected to have integer or boolean data type.
459
+ Input array, expected to have an integer or boolean data type.
448
460
out : {None, dpnp.ndarray, usm_ndarray}, optional
449
461
Output array to populate.
450
462
Array must have the correct shape and the expected data type.
@@ -514,9 +526,9 @@ def binary_repr(num, width=None):
514
526
bitwise_invert = invert # bitwise_invert is an alias for invert
515
527
516
528
_LEFT_SHIFT_DOCSTRING = """
517
- Shifts the bits of each element `x1_i` of the input array x1 to the left by
518
- appending `x2_i` (i.e., the respective element in the input array `x2`) zeros to
519
- the right of `x1_i`.
529
+ Shifts the bits of each element :math: `x1_i` of the input array `x1` to the
530
+ left by appending :math: `x2_i` (i.e., the respective element in the input array
531
+ `x2`) zeros to the right of :math: `x1_i`.
520
532
521
533
Note that :obj:`dpnp.bitwise_left_shift` is an alias of :obj:`dpnp.left_shift`.
522
534
@@ -525,14 +537,10 @@ def binary_repr(num, width=None):
525
537
Parameters
526
538
----------
527
539
x1 : {dpnp.ndarray, usm_ndarray, scalar}
528
- First input array, expected to have integer data type.
529
- Both inputs `x1` and `x2` can not be scalars at the same time.
540
+ First input array, expected to have an integer data type.
530
541
x2 : {dpnp.ndarray, usm_ndarray, scalar}
531
- Second input array, also expected to have integer data type.
542
+ Second input array, also expected to have an integer data type.
532
543
Each element must be greater than or equal to ``0``.
533
- Both inputs `x1` and `x2` can not be scalars at the same time.
534
- If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
535
- (which becomes the shape of the output).
536
544
out : {None, dpnp.ndarray, usm_ndarray}, optional
537
545
Output array to populate.
538
546
Array must have the correct shape and the expected data type.
@@ -560,6 +568,13 @@ def binary_repr(num, width=None):
560
568
:obj:`dpnp.binary_repr` : Return the binary representation of the input number
561
569
as a string.
562
570
571
+ Notes
572
+ -----
573
+ At least one of `x1` or `x2` must be an array.
574
+
575
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
576
+ (which becomes the shape of the output).
577
+
563
578
Examples
564
579
--------
565
580
>>> import dpnp as np
@@ -580,6 +595,7 @@ def binary_repr(num, width=None):
580
595
array(20)
581
596
>>> np.binary_repr(20)
582
597
'10100'
598
+
583
599
"""
584
600
585
601
left_shift = DPNPBinaryFunc (
@@ -594,8 +610,8 @@ def binary_repr(num, width=None):
594
610
595
611
596
612
_RIGHT_SHIFT_DOCSTRING = """
597
- Shifts the bits of each element `x1_i` of the input array `x1` to the right
598
- according to the respective element `x2_i` of the input array `x2`.
613
+ Shifts the bits of each element :math: `x1_i` of the input array `x1` to the
614
+ right according to the respective element :math: `x2_i` of the input array `x2`.
599
615
600
616
Note that :obj:`dpnp.bitwise_right_shift` is an alias of :obj:`dpnp.right_shift`.
601
617
@@ -604,14 +620,10 @@ def binary_repr(num, width=None):
604
620
Parameters
605
621
----------
606
622
x1 : {dpnp.ndarray, usm_ndarray, scalar}
607
- First input array, expected to have integer data type.
608
- Both inputs `x1` and `x2` can not be scalars at the same time.
623
+ First input array, expected to have an integer data type.
609
624
x2 : {dpnp.ndarray, usm_ndarray, scalar}
610
- Second input array, also expected to have integer data type.
625
+ Second input array, also expected to have an integer data type.
611
626
Each element must be greater than or equal to ``0``.
612
- Both inputs `x1` and `x2` can not be scalars at the same time.
613
- If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
614
- (which becomes the shape of the output).
615
627
out : {None, dpnp.ndarray, usm_ndarray}, optional
616
628
Output array to populate.
617
629
Array must have the correct shape and the expected data type.
@@ -640,6 +652,13 @@ def binary_repr(num, width=None):
640
652
:obj:`dpnp.binary_repr` : Return the binary representation of the input number
641
653
as a string.
642
654
655
+ Notes
656
+ -----
657
+ At least one of `x1` or `x2` must be an array.
658
+
659
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
660
+ (which becomes the shape of the output).
661
+
643
662
Examples
644
663
--------
645
664
>>> import dpnp as np
@@ -660,6 +679,7 @@ def binary_repr(num, width=None):
660
679
array(5)
661
680
>>> np.binary_repr(5)
662
681
'101'
682
+
663
683
"""
664
684
665
685
right_shift = DPNPBinaryFunc (
0 commit comments