code: def _quantize_dynamic_torch(model: Module):
      layer_types = {
          type(layer)
          for layer in model.children()
          if len(list(layer.parameters())) > 0
      }
      return torch.quantization.quantize_dynamic(
          model=model, qconfig_spec=layer_types, dtype=torch.qint8
      )
  
file_path: nebuly/optimization/nebullvm/nebullvm/operations/optimizations/compilers/quantizations/pytorch.py
imports: import copy
  from typing import List, Tuple, Union
  from loguru import logger
  from nebullvm.core.models import DeviceType, Device, QuantizationType
  from nebullvm.optional_modules.torch import torch, Module, symbolic_trace, QuantStub, DeQuantStub, GraphModule, default_dynamic_qconfig, prepare_fx, convert_fx, ScriptModule
  from nebullvm.tools.transformations import MultiStageTransformation, HalfPrecisionTransformation
  from nebullvm.tools.utils import check_module_version
label_desc: Use image node_id 1 for calling a global function with example usage: _quantize_dynamic_torch(model) and returns: torch