code: def create_tensorizers(
      model_inputs: Union[
          BaseModel.Config.ModelInput, Dict[str, Tensorizer.Config]
      ]
  ) -> Dict[str, Tensorizer]:
      if not isinstance(model_inputs, dict):
          model_inputs = model_inputs._asdict()
  
      tensorizers = {
          name: create_component(
              ComponentType.TENSORIZER, tensorizer_config
          )
          for name, tensorizer_config in model_inputs.items()
          if tensorizer_config
      }
  
      return tensorizers
  
imports: from typing import Any, Dict, Optional, Type, Union
  import torch
  from accelerators.pytorch.lib.accelerator_lowering import lower_modules_to_accelerator, lower_split_model_to_accelerator
  from accelerators.pytorch.lib.export_helper import AccelerateOptions
  from accelerators.pytorch.lib.model_rewriter import find_module_instances, MODULE_TO_REWRITER, rewrite_nnpi_modules, swap_modules
  from accelerators.pytorch.lib.quantize import quantize_fx, quantize_statically
  from pytext.common.constants import Stage
  from pytext.config import ConfigBase, ExportConfig, PyTextConfig
  from pytext.config.component import ComponentType, create_component, create_trainer
  from pytext.data.data import Data
  from pytext.data.sources.data_source import Schema
  from pytext.data.tensorizers import Tensorizer
  from pytext.metric_reporters import MetricReporter
  from pytext.models.model import BaseModel
  from pytext.models.representations.bilstm import BiLSTM
  from pytext.models.roberta import RoBERTaEncoder
  from pytext.trainers import TaskTrainer, TrainingState
  from pytext.utils import cuda, onnx, precision
  from pytext.utils.file_io import PathManager
  from pytext.utils.usage import log_accelerator_feature_usage, log_class_usage, log_feature_usage
  from torch import sort
  from .task import TaskBase
label_desc: Use image node_id 2 for calling a global function with example usage: create_tensorizers(model_inputs) and returns: tensorizers