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.unbind on CUDALongTensor
docstr_tok: ["Test","torch.unbind","on","CUDALongTensor"]
code: def test_torch_unbind(self) -> None:
      """Test torch.unbind on CUDALongTensor"""
      sizes = [
          (1,),
          (5,),
          (1, 1),
          (1, 5),
          (5, 5),
          (1, 1, 1),
          (5, 5, 5),
          (1, 1, 1, 1),
          (5, 5, 5, 5),
      ]
      for size in sizes:
          tensor = get_random_test_tensor(size=size, is_float=False)
          t_cuda = CUDALongTensor(tensor)
          for dim in range(tensor.dim()):
              reference = tensor.unbind(dim)
              result = torch.unbind(t_cuda, dim)
              result2 = t_cuda.unbind(dim)
  
              for i in range(len(result)):
                  self.assertTrue(
                      type(result[i]) == CUDALongTensor,
                      "result should be a CUDALongTensor",
                  )
                  self.assertTrue(
                      type(result2[i]) == CUDALongTensor,
                      "result should be a CUDALongTensor",
                  )
                  self._check_int(
                      result[i].cpu(),
                      reference[i],
                      "unbind failed on CUDALongTensor",
                  )
                  self._check_int(
                      result2[i].cpu(),
                      reference[i],
                      "unbind failed on CUDALongTensor",
                  )
  
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 22 for calling the TestCUDA obj's underlying member method code with example usage: obj.test_torch_unbind() without return types