class_docstr: This class tests all functions of CUDALongTensor as well as its integration with MPCTensor.
class_docstr_tok: ["This","class","tests","all","functions","of","CUDALongTensor","as","well","as","its","integration","with","MPCTensor","."]
docstr: Test avg_pool2d on CUDALongTensor
code: def test_torch_avg_pool2d(self) -> None:
      """Test avg_pool2d on CUDALongTensor"""
      for width in range(2, 5):
          for kernel_size in range(1, width):
              matrix_size = (1, 4, 5, width)
              matrix = get_random_test_tensor(
                  size=matrix_size, is_float=False
              )
              matrix_cuda = CUDALongTensor(matrix)
              for stride in range(1, kernel_size + 1):
                  for padding in range(kernel_size // 2 + 1):
                      for divisor_override in [None, 1, 2]:
                          reference = F.avg_pool2d(
                              matrix,
                              kernel_size,
                              stride=stride,
                              padding=padding,
                              divisor_override=divisor_override,
                          )
                          result = F.avg_pool2d(
                              matrix_cuda,
                              kernel_size,
                              stride=stride,
                              padding=padding,
                              divisor_override=divisor_override,
                          )
  
                          self._check_int(
                              result.cpu(),
                              reference,
                              "avg_pool2d failed",
                          )
  
imports: import collections
  import itertools
  import logging
  import unittest
  import crypten
  import torch
  import torch.nn
  import torch.nn.functional
  from crypten.config import cfg
  from crypten.cuda import CUDALongTensor
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
  from test.test_mpc import TestMPC
label_desc: Use image node_id 18 for calling the TestCUDA obj's underlying member method code with example usage: obj.test_torch_avg_pool2d() without return types