|
347 | 347 | ) |
348 | 348 | del _bitwise_and_docstring_ |
349 | 349 |
|
| 350 | +# B04: ===== BITWISE_LEFT_SHIFT (x1, x2) |
| 351 | +_bitwise_left_shift_docstring_ = r""" |
| 352 | +bitwise_left_shift(x1, x2, /, \*, out=None, order='K') |
| 353 | +
|
| 354 | +Shifts the bits of each element `x1_i` of the input array x1 to the left by |
| 355 | +appending `x2_i` (i.e., the respective element in the input array `x2`) zeros to |
| 356 | +the right of `x1_i`. |
| 357 | +
|
| 358 | +Args: |
| 359 | + x1 (usm_ndarray): |
| 360 | + First input array, expected to have integer data type. |
| 361 | + x2 (usm_ndarray): |
| 362 | + Second input array, also expected to have integer data type. |
| 363 | + Each element must be greater than or equal to 0. |
| 364 | + out (Union[usm_ndarray, None], optional): |
| 365 | + Output array to populate. |
| 366 | + Array must have the correct shape and the expected data type. |
| 367 | + order ("C","F","A","K", optional): |
| 368 | + Memory layout of the new output array, if parameter |
| 369 | + `out` is ``None``. |
| 370 | + Default: "K". |
| 371 | +
|
| 372 | +Returns: |
| 373 | + usm_ndarray: |
| 374 | + An array containing the element-wise results. The data type |
| 375 | + of the returned array is determined by the Type Promotion Rules. |
| 376 | +""" |
| 377 | + |
| 378 | +bitwise_left_shift = BinaryElementwiseFunc( |
| 379 | + "bitwise_left_shift", |
| 380 | + ti._bitwise_left_shift_result_type, |
| 381 | + ti._bitwise_left_shift, |
| 382 | + _bitwise_left_shift_docstring_, |
| 383 | + binary_inplace_fn=ti._bitwise_left_shift_inplace, |
| 384 | +) |
| 385 | +del _bitwise_left_shift_docstring_ |
| 386 | + |
350 | 387 | # U08: ===== BITWISE_INVERT (x) |
351 | 388 | _bitwise_invert_docstring = r""" |
352 | 389 | bitwise_invert(x, /, \*, out=None, order='K') |
|
379 | 416 | ) |
380 | 417 | del _bitwise_invert_docstring |
381 | 418 |
|
| 419 | +# B05: ===== BITWISE_OR (x1, x2) |
| 420 | +_bitwise_or_docstring_ = r""" |
| 421 | +bitwise_or(x1, x2, /, \*, out=None, order='K') |
| 422 | +
|
| 423 | +Computes the bitwise OR of the underlying binary representation of each |
| 424 | +element `x1_i` of the input array `x1` with the respective element `x2_i` |
| 425 | +of the input array `x2`. |
| 426 | +
|
| 427 | +Args: |
| 428 | + x1 (usm_ndarray): |
| 429 | + First input array, expected to have integer or boolean data type. |
| 430 | + x2 (usm_ndarray): |
| 431 | + Second input array, also expected to have integer or boolean data |
| 432 | + type. |
| 433 | + out (Union[usm_ndarray, None], optional): |
| 434 | + Output array to populate. |
| 435 | + Array must have the correct shape and the expected data type. |
| 436 | + order ("C","F","A","K", optional): |
| 437 | + Memory layout of the new output array, if parameter |
| 438 | + `out` is ``None``. |
| 439 | + Default: "K". |
| 440 | +
|
| 441 | +Returns: |
| 442 | + usm_ndarray: |
| 443 | + An array containing the element-wise results. The data type |
| 444 | + of the returned array is determined by the Type Promotion Rules. |
| 445 | +""" |
| 446 | + |
| 447 | +bitwise_or = BinaryElementwiseFunc( |
| 448 | + "bitwise_or", |
| 449 | + ti._bitwise_or_result_type, |
| 450 | + ti._bitwise_or, |
| 451 | + _bitwise_or_docstring_, |
| 452 | + binary_inplace_fn=ti._bitwise_or_inplace, |
| 453 | +) |
| 454 | +del _bitwise_or_docstring_ |
| 455 | + |
| 456 | +# B06: ===== BITWISE_RIGHT_SHIFT (x1, x2) |
| 457 | +_bitwise_right_shift_docstring_ = r""" |
| 458 | +bitwise_right_shift(x1, x2, /, \*, out=None, order='K') |
| 459 | +
|
| 460 | +Shifts the bits of each element `x1_i` of the input array `x1` to the right |
| 461 | +according to the respective element `x2_i` of the input array `x2`. |
| 462 | +
|
| 463 | +Args: |
| 464 | + x1 (usm_ndarray): |
| 465 | + First input array, expected to have integer data type. |
| 466 | + x2 (usm_ndarray): |
| 467 | + Second input array, also expected to have integer data type. |
| 468 | + Each element must be greater than or equal to 0. |
| 469 | + out (Union[usm_ndarray, None], optional): |
| 470 | + Output array to populate. |
| 471 | + Array must have the correct shape and the expected data type. |
| 472 | + order ("C","F","A","K", optional): |
| 473 | + Memory layout of the new output array, if parameter |
| 474 | + `out` is ``None``. |
| 475 | + Default: "K". |
| 476 | +
|
| 477 | +Returns: |
| 478 | + usm_ndarray: |
| 479 | + An array containing the element-wise results. The data type |
| 480 | + of the returned array is determined by the Type Promotion Rules. |
| 481 | +""" |
| 482 | + |
| 483 | +bitwise_right_shift = BinaryElementwiseFunc( |
| 484 | + "bitwise_right_shift", |
| 485 | + ti._bitwise_right_shift_result_type, |
| 486 | + ti._bitwise_right_shift, |
| 487 | + _bitwise_right_shift_docstring_, |
| 488 | + binary_inplace_fn=ti._bitwise_right_shift_inplace, |
| 489 | +) |
| 490 | +del _bitwise_right_shift_docstring_ |
| 491 | + |
| 492 | + |
| 493 | +# B07: ===== BITWISE_XOR (x1, x2) |
| 494 | +_bitwise_xor_docstring_ = r""" |
| 495 | +bitwise_xor(x1, x2, /, \*, out=None, order='K') |
| 496 | +
|
| 497 | +Computes the bitwise XOR of the underlying binary representation of each |
| 498 | +element `x1_i` of the input array `x1` with the respective element `x2_i` |
| 499 | +of the input array `x2`. |
| 500 | +
|
| 501 | +Args: |
| 502 | + x1 (usm_ndarray): |
| 503 | + First input array, expected to have integer or boolean data type. |
| 504 | + x2 (usm_ndarray): |
| 505 | + Second input array, also expected to have integer or boolean data |
| 506 | + type. |
| 507 | + out (Union[usm_ndarray, None], optional): |
| 508 | + Output array to populate. |
| 509 | + Array must have the correct shape and the expected data type. |
| 510 | + order ("C","F","A","K", optional): |
| 511 | + Memory layout of the new output array, if parameter |
| 512 | + `out` is ``None``. |
| 513 | + Default: "K". |
| 514 | +
|
| 515 | +Returns: |
| 516 | + usm_ndarray: |
| 517 | + An array containing the element-wise results. The data type |
| 518 | + of the returned array is determined by the Type Promotion Rules. |
| 519 | +""" |
| 520 | + |
| 521 | +bitwise_xor = BinaryElementwiseFunc( |
| 522 | + "bitwise_xor", |
| 523 | + ti._bitwise_xor_result_type, |
| 524 | + ti._bitwise_xor, |
| 525 | + _bitwise_xor_docstring_, |
| 526 | + binary_inplace_fn=ti._bitwise_xor_inplace, |
| 527 | +) |
| 528 | +del _bitwise_xor_docstring_ |
| 529 | + |
382 | 530 | # U09: ==== CEIL (x) |
383 | 531 | _ceil_docstring = r""" |
384 | 532 | ceil(x, /, \*, out=None, order='K') |
|
0 commit comments