code: def transpose(tens: Tensor) -> Tensor:
      if len(tens.shape) > 2:
          return tens.transpose(1, 0, 2)
      else:
          return tens.transpose(1, 0)
  
imports: import numpy
  import cv2
  import random
  import collections
  from ..coreten import Tensor, to_tensor
  from .._internal import _check_target_size
  from ..globals import INTER_AREA, INTER_CUBIC, INTER_NEAREST, INTER_LINEAR
  from ..annotations import Union, Tuple, Optional
label_desc: Use image node_id 8 for calling a global function with example usage: transpose(tens) and returns: tens, tens