|
572 | 572 | # FIXME: implement B15
|
573 | 573 |
|
574 | 574 | # B16: ==== LOGICAL_AND (x1, x2)
|
575 |
| -# FIXME: implement B16 |
| 575 | +_logical_and_docstring_ = """ |
| 576 | +logical_and(x1, x2, out=None, order='K') |
| 577 | +
|
| 578 | +Computes the logical AND for each element `x1_i` of the input array `x1` |
| 579 | +with the respective element `x2_i` of the input array `x2`. |
| 580 | +
|
| 581 | +Args: |
| 582 | + x1 (usm_ndarray): |
| 583 | + First input array. |
| 584 | + x2 (usm_ndarray): |
| 585 | + Second input array. |
| 586 | + out ({None, usm_ndarray}, optional): |
| 587 | + Output array to populate. |
| 588 | + Array have the correct shape and the expected data type. |
| 589 | + order ("C","F","A","K", optional): |
| 590 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 591 | + Default: "K". |
| 592 | +Returns: |
| 593 | + usm_narray: |
| 594 | + An array containing the element-wise logical AND results. |
| 595 | +""" |
| 596 | +logical_and = BinaryElementwiseFunc( |
| 597 | + "logical_and", |
| 598 | + ti._logical_and_result_type, |
| 599 | + ti._logical_and, |
| 600 | + _logical_and_docstring_, |
| 601 | +) |
576 | 602 |
|
577 | 603 | # U24: ==== LOGICAL_NOT (x)
|
578 |
| -# FIXME: implement U24 |
| 604 | +_logical_not_docstring = """ |
| 605 | +logical_not(x, out=None, order='K') |
| 606 | +Computes the logical NOT for each element `x_i` of input array `x`. |
| 607 | +Args: |
| 608 | + x (usm_ndarray): |
| 609 | + Input array. |
| 610 | + out (usm_ndarray): |
| 611 | + Output array to populate. Array must have the correct |
| 612 | + shape and the expected data type. |
| 613 | + order ("C","F","A","K", optional): memory layout of the new |
| 614 | + output array, if parameter `out` is `None`. |
| 615 | + Default: "K". |
| 616 | +Return: |
| 617 | + usm_ndarray: |
| 618 | + An array containing the element-wise logical NOT results. |
| 619 | +""" |
| 620 | + |
| 621 | +logical_not = UnaryElementwiseFunc( |
| 622 | + "logical_not", |
| 623 | + ti._logical_not_result_type, |
| 624 | + ti._logical_not, |
| 625 | + _logical_not_docstring, |
| 626 | +) |
579 | 627 |
|
580 | 628 | # B17: ==== LOGICAL_OR (x1, x2)
|
581 |
| -# FIXME: implement B17 |
| 629 | +_logical_or_docstring_ = """ |
| 630 | +logical_or(x1, x2, out=None, order='K') |
| 631 | +
|
| 632 | +Computes the logical OR for each element `x1_i` of the input array `x1` |
| 633 | +with the respective element `x2_i` of the input array `x2`. |
| 634 | +
|
| 635 | +Args: |
| 636 | + x1 (usm_ndarray): |
| 637 | + First input array. |
| 638 | + x2 (usm_ndarray): |
| 639 | + Second input array. |
| 640 | + out ({None, usm_ndarray}, optional): |
| 641 | + Output array to populate. |
| 642 | + Array have the correct shape and the expected data type. |
| 643 | + order ("C","F","A","K", optional): |
| 644 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 645 | + Default: "K". |
| 646 | +Returns: |
| 647 | + usm_narray: |
| 648 | + An array containing the element-wise logical OR results. |
| 649 | +""" |
| 650 | +logical_or = BinaryElementwiseFunc( |
| 651 | + "logical_or", |
| 652 | + ti._logical_or_result_type, |
| 653 | + ti._logical_or, |
| 654 | + _logical_or_docstring_, |
| 655 | +) |
582 | 656 |
|
583 | 657 | # B18: ==== LOGICAL_XOR (x1, x2)
|
584 |
| -# FIXME: implement B18 |
| 658 | +_logical_xor_docstring_ = """ |
| 659 | +logical_xor(x1, x2, out=None, order='K') |
| 660 | +
|
| 661 | +Computes the logical XOR for each element `x1_i` of the input array `x1` |
| 662 | +with the respective element `x2_i` of the input array `x2`. |
| 663 | +
|
| 664 | +Args: |
| 665 | + x1 (usm_ndarray): |
| 666 | + First input array. |
| 667 | + x2 (usm_ndarray): |
| 668 | + Second input array. |
| 669 | + out ({None, usm_ndarray}, optional): |
| 670 | + Output array to populate. |
| 671 | + Array have the correct shape and the expected data type. |
| 672 | + order ("C","F","A","K", optional): |
| 673 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 674 | + Default: "K". |
| 675 | +Returns: |
| 676 | + usm_narray: |
| 677 | + An array containing the element-wise logical XOR results. |
| 678 | +""" |
| 679 | +logical_xor = BinaryElementwiseFunc( |
| 680 | + "logical_xor", |
| 681 | + ti._logical_xor_result_type, |
| 682 | + ti._logical_xor, |
| 683 | + _logical_xor_docstring_, |
| 684 | +) |
585 | 685 |
|
586 | 686 | # B19: ==== MULTIPLY (x1, x2)
|
587 | 687 | _multiply_docstring_ = """
|
|
0 commit comments