class_docstr: This class tests all functions of BinarySharedTensor.
class_docstr_tok: ["This","class","tests","all","functions","of","BinarySharedTensor","."]
docstr: Test the permute operations
docstr_tok: ["Test","the","permute","operations"]
code: def test_permute(self) -> None:
      """Test the permute operations"""
      sizes = [
          (1,),
          (5,),
          (1, 5),
          (1, 5, 7),
          (7, 1, 5),
          (5, 7, 1),
          (1, 3, 5, 7),
          (5, 3, 32, 32),
      ]
      for size in sizes:
          tensor = get_random_test_tensor(size=size, is_float=False)
          encrypted_tensor = BinarySharedTensor(tensor)
  
          # test reversing the dimensions
          dim_arr = [x - 1 for x in range(tensor.dim(), 0, -1)]
          reference = tensor.permute(dim_arr)
          encrypted_out = encrypted_tensor.permute(dim_arr)
          self._check(encrypted_out, reference, "permute failed")
  
          # test one particular non-reversed permutation
          if tensor.dim() == 4:
              dim_arr = [1, 3, 0, 2]
              reference = tensor.permute(dim_arr)
              encrypted_out = encrypted_tensor.permute(dim_arr)
              self._check(encrypted_out, reference, "permute failed")
  
imports: import itertools
  import logging
  import unittest
  import crypten
  import torch
  from crypten.common.tensor_types import is_int_tensor
  from crypten.mpc.primitives import BinarySharedTensor
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
label_desc: Use image node_id 5 for calling the TestBinary obj's underlying member method code with example usage: obj.test_permute() without return types