code: def loss_creator(loss_name):
      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)()
  
file_path: BigDL/python/chronos/src/bigdl/chronos/model/autoformer/Autoformer.py
imports: import torch
  import torch.nn
  from .layers.Embed import DataEmbedding_wo_pos
  from .layers.AutoCorrelation import AutoCorrelation, AutoCorrelationLayer
  from .layers.Autoformer_EncDec import Encoder, Decoder, EncoderLayer, DecoderLayer, my_Layernorm, series_decomp
  import torch.optim
  import pytorch_lightning
  from collections import namedtuple
  from ..utils import PYTORCH_REGRESSION_LOSS_MAP
label_desc: Use image node_id 2 for calling a global function with example usage: loss_creator(loss_name) and returns: getattr