code: def _extract_dynamic_axis(
      onnx_model: str,
      data: List[Tuple[Tuple[np.ndarray, ...], np.ndarray]],
      input_sizes: List[Tuple[int, ...]],
      device: Device,
      max_data: int = 100,
  ) -> Optional[Dict]:
      from nebullvm.tools.utils import inspect_dynamic_size
  
      dynamic_axis = {"inputs": [{}] * len(input_sizes), "outputs": []}
      output_sizes = []
      for i, input_data in enumerate(data):
          input_tensors = input_data[0]
          if i >= max_data:
              break
          inspect_dynamic_size(
              input_tensors, input_sizes, dynamic_axis["inputs"]
          )
          outputs = tuple(
              run_onnx_model(onnx_model, list(input_tensors), device)
          )
          if i == 0:
              dynamic_axis["outputs"] = [{}] * len(outputs)
              output_sizes = [
                  tuple(output.shape[1:]) for output in outputs
              ]
          inspect_dynamic_size(
              outputs, output_sizes, dynamic_axis["outputs"]
          )
      if any(
          len(x) > 0
          for x in (dynamic_axis["inputs"] + dynamic_axis["outputs"])
      ):
          return dynamic_axis
      return None
  
file_path: nebuly/optimization/nebullvm/nebullvm/tools/onnx.py
imports: from typing import List, Tuple, Any, Optional, Dict
  import numpy
  from loguru import logger
  from nebullvm.config import ONNX_PROVIDERS
  from nebullvm.core.models import DeepLearningFramework, Device, DeviceType, InputInfo, DataType
  from nebullvm.optional_modules.onnx import onnx
  from nebullvm.optional_modules.onnxruntime import onnxruntime
  from nebullvm.optional_modules.tensorflow import tensorflow
  from nebullvm.optional_modules.torch import torch
label_desc: Use image node_id 6 for calling a global function with example usage: _extract_dynamic_axis(onnx_model, data, input_sizes, device, max_data) and returns: None, dynamic_axis