code: def loss_creator(config):
      loss_name = config.get("loss", "mse")
      if loss_name in PYTORCH_REGRESSION_LOSS_MAP:
          loss_name = PYTORCH_REGRESSION_LOSS_MAP[loss_name]
      else:
          from bigdl.nano.utils.common import invalidInputError
  
          invalidInputError(
              False,
              f"Got '{loss_name}' for loss name, "
              "where 'mse', 'mae' or 'huber_loss' is expected",
          )
      return getattr(torch.nn, loss_name)()
  
imports: import warnings
  import torch
  import torch.nn
  from .utils import PYTORCH_REGRESSION_LOSS_MAP
  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 3 for calling a global function with example usage: loss_creator(config) and returns: getattr