code: def _apply_permutation(
      tensor: Tensor, permutation: Tensor, dim: int = 1
  ) -> Tensor:
      return tensor.index_select(dim, permutation)
  
imports: import torch
  import torch.nn
  from torch import Tensor
  from .utils import _quantize_and_dequantize_weight
  from .utils import _quantize_weight
  from typing import Optional, Dict, Any, Tuple
  from torch import _VF
  from torch.nn.utils.rnn import PackedSequence
label_desc: Use image node_id 1 for calling a global function with example usage: _apply_permutation(tensor, permutation, dim) and returns: tensor