class_docstr: This class tests all functions of BinarySharedTensor.
class_docstr_tok: ["This","class","tests","all","functions","of","BinarySharedTensor","."]
docstr: Test bitwise-XOR function on BinarySharedTensor
docstr_tok: ["Test","bitwise-XOR","function","on","BinarySharedTensor"]
code: def test_XOR(self) -> None:
      """Test bitwise-XOR function on BinarySharedTensor"""
      for tensor_type in [lambda x: x, BinarySharedTensor]:
          tensor = get_random_test_tensor(is_float=False)
          tensor2 = get_random_test_tensor(is_float=False)
          reference = tensor ^ tensor2
          encrypted_tensor = BinarySharedTensor(tensor)
          encrypted_tensor2 = tensor_type(tensor2)
          encrypted_out = encrypted_tensor ^ encrypted_tensor2
          self._check(
              encrypted_out, reference, "%s XOR failed" % tensor_type
          )
  
imports: import itertools
  import logging
  import unittest
  import crypten
  import torch
  from crypten.common.tensor_types import is_int_tensor
  from crypten.mpc.primitives import BinarySharedTensor
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
label_desc: Use image node_id 6 for calling the TestBinary obj's underlying member method code with example usage: obj.test_XOR() without return types