code: def model_creator(config):
      hidden_dim = config.get("hidden_dim", 32)
      dropout = config.get("dropout", 0.2)
      layer_num = config.get("layer_num", 2)
      from bigdl.nano.utils.common import invalidInputError
  
      if isinstance(hidden_dim, list):
          invalidInputError(
              len(hidden_dim) == layer_num,
              "length of hidden_dim should be equal to layer_num",
          )
      if isinstance(dropout, list):
          invalidInputError(
              len(dropout) == layer_num,
              "length of dropout should be equal to layer_num",
          )
      if isinstance(hidden_dim, int):
          hidden_dim = [hidden_dim] * layer_num
      if isinstance(dropout, (float, int)):
          dropout = [dropout] * layer_num
  
      model = LSTMModel(
          input_dim=config["input_feature_num"],
          hidden_dim=hidden_dim,
          layer_num=layer_num,
          dropout=dropout,
          output_dim=config["output_feature_num"],
          seed=config.get("seed", None),
      )
      if config.get("normalization", False):
          model = NormalizeTSModel(model, config["output_feature_num"])
      decomposition_kernel_size = config.get(
          "decomposition_kernel_size", 0
      )
      if decomposition_kernel_size > 1:
          model_copy = LSTMModel(
              input_dim=config["input_feature_num"],
              hidden_dim=hidden_dim,
              layer_num=layer_num,
              dropout=dropout,
              output_dim=config["output_feature_num"],
              seed=config.get("seed", None),
          )
          if config.get("normalization", False):
              model_copy = NormalizeTSModel(
                  model_copy, config["output_feature_num"]
              )
          model = DecompositionTSModel(
              (model, model_copy), decomposition_kernel_size
          )
  
      return model
  
file_path: BigDL/python/chronos/src/bigdl/chronos/model/VanillaLSTM_pytorch.py
imports: import torch
  import torch.nn
  from pytorch_lightning import seed_everything
  from bigdl.chronos.pytorch.model_wrapper.normalization import NormalizeTSModel
  from bigdl.chronos.pytorch.model_wrapper.decomposition import DecompositionTSModel
label_desc: Use image node_id 1 for calling a global function with example usage: model_creator(config) and returns: model