Bitwise

and

INDArray and(INDArray x, INDArray y)

SDVariable and(SDVariable x, SDVariable y)
SDVariable and(String name, SDVariable x, SDVariable y)

Bitwise AND operation. Supports broadcasting.

  • x (INT) - First input array

  • y (INT) - Second input array

bitRotl

INDArray bitRotl(INDArray x, INDArray shift)

SDVariable bitRotl(SDVariable x, SDVariable shift)
SDVariable bitRotl(String name, SDVariable x, SDVariable shift)

Roll integer bits to the left, i.e. var << 4 | var >> (32 - 4)

  • x (INT) - Input 1

  • shift (INT) - Number of bits to shift.

bitRotr

Roll integer bits to the right, i.e. var >> 4 | var << (32 - 4)

  • x (INT) - Input 1

  • shift (INT) - Number of bits to shift.

bitShift

Shift integer bits to the left, i.e. var << 4

  • x (INT) - Input 1

  • shift (INT) - Number of bits to shift.

bitShiftRight

Shift integer bits to the right, i.e. var >> 4

  • x (INT) - Input 1

  • shift (INT) - Number of bits to shift.

bitsHammingDistance

Bitwise Hamming distance reduction over all elements of both input arrays. For example, if x=01100000 and y=1010000 then the bitwise Hamming distance is 2 (due to differences at positions 0 and 1)

  • x (INT) - First input array.

  • y (INT) - Second input array.

leftShift

Bitwise left shift operation. Supports broadcasting.

  • x (INT) - Input to be bit shifted

  • y (INT) - Amount to shift elements of x array

leftShiftCyclic

Bitwise left cyclical shift operation. Supports broadcasting.

Unlike #leftShift(INDArray, INDArray) the bits will "wrap around":

leftShiftCyclic(01110000, 2) -> 11000001

  • x (INT) - Input to be bit shifted

  • y (INT) - Amount to shift elements of x array

or

Bitwise OR operation. Supports broadcasting.

  • x (INT) - First input array

  • y (INT) - First input array

rightShift

Bitwise right shift operation. Supports broadcasting.

  • x (INT) - Input to be bit shifted

  • y (INT) - Amount to shift elements of x array

rightShiftCyclic

Bitwise right cyclical shift operation. Supports broadcasting.

Unlike rightShift(INDArray, INDArray) the bits will "wrap around":

rightShiftCyclic(00001110, 2) -> 10000011

  • x (INT) - Input to be bit shifted

  • y (INT) - Amount to shift elements of x array

xor

Bitwise XOR operation (exclusive OR). Supports broadcasting.

  • x (INT) - First input array

  • y (INT) - First input array

Last updated

Was this helpful?