spike_bitwise_xor

spike_bitwise_xor#

class braintools.spike_bitwise_xor(x, y)#

Perform a bitwise XOR operation on spike tensors.

This function computes the XOR operation between two spike tensors. XOR is defined as (x OR y) AND NOT (x AND y).

Parameters:
  • x (Tensor) – The first input spike tensor.

  • y (Tensor) – The second input spike tensor.

Returns:

The result of the bitwise XOR operation applied to the input tensors.

The output tensor has the same shape as the input tensors.

Return type:

Tensor

Note

This operation is implemented using the formula: x + y - 2 * x * y, which is equivalent to the XOR operation for binary values.