code: def _extract_dynamic_axis(
      tf_model: tf.Module,
      dataset: List[Tuple[Tuple[tf.Tensor, ...], Any]],
      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(dataset):
          input_tensors = input_data[0]
          if i >= max_data:
              break
          inspect_dynamic_size(
              input_tensors, input_sizes, dynamic_axis["inputs"]
          )
          outputs = tuple(run_tf_model(tf_model, 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/tf.py
imports: from typing import Union, List, Tuple, Any, Optional, Dict
  import numpy
  from loguru import logger
  from nebullvm.core.models import Device, DataType, InputInfo
  from nebullvm.optional_modules.tensorflow import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: _extract_dynamic_axis(tf_model, dataset, input_sizes, device, max_data) and returns: None, dynamic_axis