code: def permute_final_dims(tensor: torch.Tensor, inds: List[int]):
      zero_index = -1 * len(inds)
      first_inds = list(range(len(tensor.shape[:zero_index])))
      return tensor.permute(first_inds + [zero_index + i for i in inds])
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/esm/openfold_utils/tensor_utils.py
imports: from functools import partial
  from typing import List
  import torch
  import torch.nn
label_desc: Use image node_id 2 for calling a global function with example usage: permute_final_dims(tensor, inds) and returns: tensor