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 torch arithmetic on CUDALongTensor
code: def test_torch_arithmetic(self) -> None:
      """Test torch arithmetic on CUDALongTensor"""
      funcs = ["add", "sub", "mul", "div"]
      a = get_random_test_tensor(is_float=False)
      b = get_random_test_tensor(min_value=1, is_float=False)
  
      a_cuda = CUDALongTensor(a)
      b_cuda = CUDALongTensor(b)
  
      for op in funcs:
          kwargs = {"rounding_mode": "trunc"} if op == "div" else {}
  
          reference = getattr(torch, op)(a, b, **kwargs)
          result = getattr(torch, op)(a_cuda, b_cuda, **kwargs)
          result2 = getattr(a_cuda, op)(b_cuda, **kwargs)
  
          self.assertTrue(type(result), CUDALongTensor)
          self._check_int(
              reference,
              result.cpu(),
              "torch.{} failed for CUDALongTensor".format(op),
          )
          self._check_int(
              reference,
              result2.cpu(),
              "torch.{} failed for CUDALongTensor".format(op),
          )
  
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 16 for calling the TestCUDA obj's underlying member method code with example usage: obj.test_torch_arithmetic() without return types