class_docstr: This class tests all functions of BinarySharedTensor.
class_docstr_tok: ["This","class","tests","all","functions","of","BinarySharedTensor","."]
docstr: Tests sum using binary shares
docstr_tok: ["Tests","sum","using","binary","shares"]
code: def test_sum(self) -> None:
      """Tests sum using binary shares"""
      tensor = get_random_test_tensor(size=(5, 5, 5), is_float=False)
      encrypted = BinarySharedTensor(tensor)
      self._check(encrypted.sum(), tensor.sum(), "sum failed")
  
      for dim in [0, 1, 2]:
          reference = tensor.sum(dim)
          encrypted_out = encrypted.sum(dim)
          self._check(encrypted_out, reference, "sum failed")
  
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 13 for calling the TestBinary obj's underlying member method code with example usage: obj.test_sum() without return types