code: def _extract_dynamic_shape_ranges(model_params: ModelParams):
      inputs_shapes = []
  
      for i, info in enumerate(model_params.input_infos):
          static_shape = info.size
  
          if model_params.dynamic_info is not None:
              input_dict = model_params.dynamic_info.inputs[i]
  
              assert all(
                  key in dim
                  for dim in input_dict.values()
                  for key in ["min_val", "opt_val", "max_val"]
              ), (
                  "Missing min/opt/max ranges, TensorRT needs them to "
                  "enable dynamic shape properly"
              )
  
              shape_dict = {
                  "min_shape": [
                      static_shape[j]
                      if j not in input_dict
                      else input_dict[j]["min_val"]
                      for j in range(len(static_shape))
                  ],
                  "opt_shape": [
                      static_shape[j]
                      if j not in input_dict
                      else input_dict[j]["opt_val"]
                      for j in range(len(static_shape))
                  ],
                  "max_shape": [
                      static_shape[j]
                      if j not in input_dict
                      else input_dict[j]["max_val"]
                      for j in range(len(static_shape))
                  ],
              }
              inputs_shapes.append(shape_dict)
          else:
              inputs_shapes.append({"shape": static_shape})
  
      return inputs_shapes
  
imports: import abc
  import copy
  import os
  import subprocess
  from pathlib import Path
  from typing import List, Any, Tuple
  import numpy
  from nebullvm.config import QUANTIZATION_DATA_NUM, TORCH_TENSORRT_PRECISIONS
  from nebullvm.core.models import QuantizationType, ModelParams
  from nebullvm.operations.optimizations.compilers.base import Compiler
  from nebullvm.operations.optimizations.compilers.quantizations.tensor_rt import quantize_tensorrt
  from nebullvm.operations.optimizations.compilers.quantizations.utils import check_quantization
  from nebullvm.optional_modules.onnx import onnx
  from nebullvm.optional_modules.tensor_rt import tensorrt
  from nebullvm.optional_modules.torch import torch, Module
  from nebullvm.optional_modules.torch_tensorrt import torch_tensorrt, DataLoaderCalibrator
  from nebullvm.tools.data import DataManager, PytorchDataset
  from nebullvm.tools.diffusers import UNet
  from nebullvm.tools.onnx import get_input_names
  from nebullvm.tools.transformations import MultiStageTransformation, HalfPrecisionTransformation
label_desc: Use image node_id 2 for calling the TensorRTCompiler obj's underlying member method code with example usage: obj._extract_dynamic_shape_ranges(model_params) and returns: inputs_shapes