code: def flatten_final_dims(t: torch.Tensor, no_dims: int):
      return t.reshape(t.shape[:-no_dims] + (-1,))
  
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 3 for calling a global function with example usage: flatten_final_dims(t, no_dims) and returns: t