class_docstr: This class tests all functions of the ArithmeticSharedTensor.
docstr: Tests sum reduction on encrypted tensor.
docstr_tok: ["Tests","sum","reduction","on","encrypted","tensor","."]
code: def test_sum(self) -> None:
      """Tests sum reduction on encrypted tensor."""
      tensor = get_random_test_tensor(size=(5, 100, 100), is_float=True)
      encrypted = ArithmeticSharedTensor(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 crypten.communicator
  import torch
  import torch.nn.functional
  from crypten.common.rng import generate_random_ring_element
  from crypten.common.tensor_types import is_float_tensor
  from crypten.common.util import count_wraps
  from crypten.mpc.primitives import ArithmeticSharedTensor
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
label_desc: Use image node_id 6 for calling the TestArithmetic obj's underlying member method code with example usage: obj.test_sum() without return types