class_docstr: This class tests all member functions of crypten package
class_docstr_tok: ["This","class","tests","all","member","functions","of","crypten","package"]
code: def _check(self, encrypted_tensor, reference, msg, tolerance=None):
      if tolerance is None:
          tolerance = getattr(self, "default_tolerance", 0.05)
      tensor = encrypted_tensor.get_plain_text()
  
      # Check sizes match
      self.assertTrue(tensor.size() == reference.size(), msg)
  
      self.assertTrue(
          is_float_tensor(reference), "reference must be a float"
      )
      diff = (tensor - reference).abs_()
      norm_diff = diff.div(tensor.abs() + reference.abs()).abs_()
      test_passed = norm_diff.le(tolerance) + diff.le(tolerance * 0.1)
      test_passed = test_passed.gt(0).all().item() == 1
      if not test_passed:
          logging.info(msg)
          logging.info("Result %s" % tensor)
          logging.info(
              "Result = %s;\nreference = %s" % (tensor, reference)
          )
      self.assertTrue(test_passed, msg=msg)
  
imports: import itertools
  import logging
  import math
  import random
  import unittest
  from collections import defaultdict
  import crypten
  import crypten.communicator
  import torch
  import torch.nn.functional
  from crypten.common import serial
  from crypten.common.tensor_types import is_float_tensor
  from crypten.config import cfg
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
  from torch import nn
label_desc: Use image node_id 2 for calling the TestCrypten obj's underlying member method code with example usage: obj._check(encrypted_tensor, reference, msg, tolerance) without return types