class_docstr: This class tests all functions of BinarySharedTensor.
class_docstr_tok: ["This","class","tests","all","functions","of","BinarySharedTensor","."]
code: def _check(
      self, encrypted_tensor, reference, msg, dst=None, tolerance=None
  ):
      if tolerance is None:
          tolerance = getattr(self, "default_tolerance", 0.05)
      tensor = encrypted_tensor.get_plain_text(dst=dst)
      if dst is not None and dst != self.rank:
          self.assertIsNone(tensor)
          return
  
      # Check sizes match
      self.assertTrue(tensor.size() == reference.size(), msg)
  
      self.assertTrue(
          is_int_tensor(reference), "reference must be a long"
      )
      test_passed = (tensor == reference).all().item() == 1
      if not test_passed:
          logging.info(msg)
          logging.info("Result %s" % tensor)
          logging.info("Result - Reference = %s" % (tensor - reference))
      self.assertTrue(test_passed, msg=msg)
  
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 2 for calling the TestBinary obj's underlying member method code with example usage: obj._check(encrypted_tensor, reference, msg, dst, tolerance) without return types