class_docstr: This class tests all functions of the ArithmeticSharedTensor.
docstr: Test avgPool of encrypted tensor.
docstr_tok: ["Test","avgPool","of","encrypted","tensor","."]
code: def test_pooling(self) -> None:
      """Test avgPool of encrypted tensor."""
      for width in range(2, 5):
          for width2 in range(1, width):
              matrix_size = (1, 4, 5, width)
              matrix = get_random_test_tensor(
                  size=matrix_size, is_float=True
              )
              pool_size = width2
              for stride in range(1, width2):
                  for padding in range(2):
                      reference = F.avg_pool2d(
                          matrix,
                          pool_size,
                          stride=stride,
                          padding=padding,
                      )
  
                      encrypted_matrix = ArithmeticSharedTensor(matrix)
                      encrypted_pool = encrypted_matrix.avg_pool2d(
                          pool_size, stride=stride, padding=padding
                      )
                      self._check(
                          encrypted_pool, reference, "avg_pool2d 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 27 for calling the TestArithmetic obj's underlying member method code with example usage: obj.test_pooling() without return types