asc.experimental.asctile.bitwise_xor
- asc.experimental.asctile.bitwise_xor(input: LocalTensor | PlainValue | int | float, other: LocalTensor | PlainValue | int | float) LocalTensor
Computes the element-wise XOR (bitwise) of
inputandother.The supported data types for the inputs are:
int8,int16,int32,int64.- Parameters:
input – The left operand (tensor or scalar)
other – The right operand (tensor or scalar)
- Returns:
The result of XOR (bitwise)
- Return type:
- Raises:
RuntimeError – If neither operand is a
LocalTensor
Note
At least one of input operands must be
LocalTensor. Operands are automatically cast to a common data type and broadcast to a common shape. When one operand is aLocalTensorand the other is a scalar, the tensor’s dtype takes precedence. Inputs must either have the same shapes or be broadcastable according to NumPy broadcasting rules.Examples
Compute the XOR (bitwise) between elements of two tensors:
input = asctile.copy_in(tensor_a, [1, 4], [32, 16]) other = asctile.copy_in(tensor_b, [2, 8], [32, 16]) result = asctile.bitwise_xor(input, other)
Compute the XOR (bitwise) of tensor elements and a given scalar value:
input = asctile.copy_in(tensor, [0, 0], [32, 16]) result = asctile.bitwise_xor(input, 2)
This function can also be called via a binary operator on
LocalTensor, asinput ^ otherinstead ofbitwise_xor(input, other).