class_docstr: This class tests all member functions of crypten package
class_docstr_tok: ["This","class","tests","all","member","functions","of","crypten","package"]
docstr: Tests concatenation and stacking of tensors
code: def test_cat_stack(self):
      """Tests concatenation and stacking of tensors"""
      tensor1 = get_random_test_tensor(size=(5, 5, 5, 5), is_float=True)
      tensor2 = get_random_test_tensor(size=(5, 5, 5, 5), is_float=True)
      encrypted1 = crypten.cryptensor(tensor1)
      encrypted2 = crypten.cryptensor(tensor2)
  
      for module in [
          crypten,
          torch,
      ]:  # torch.cat on CrypTensor runs crypten.cat
          for op in ["cat", "stack"]:
              reference = getattr(torch, op)([tensor1, tensor2])
              encrypted_out = getattr(module, op)(
                  [encrypted1, encrypted2]
              )
              self._check(encrypted_out, reference, "%s failed" % op)
  
              for dim in range(4):
                  reference = getattr(torch, op)(
                      [tensor1, tensor2], dim=dim
                  )
                  encrypted_out = getattr(module, op)(
                      [encrypted1, encrypted2], dim=dim
                  )
                  self._check(
                      encrypted_out, reference, "%s failed" % op
                  )
  
imports: import itertools
  import logging
  import math
  import random
  import unittest
  from collections import defaultdict
  import crypten
  import crypten.communicator
  import torch
  import torch.nn.functional
  from crypten.common import serial
  from crypten.common.tensor_types import is_float_tensor
  from crypten.config import cfg
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
  from torch import nn
label_desc: Use image node_id 6 for calling the TestCrypten obj's underlying member method code with example usage: obj.test_cat_stack() without return types