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:
          raise RuntimeError(
              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 torch.nn.utils import weight_norm
  from zoo.orca.automl.model.base_pytorch_model import PytorchBaseModel, PYTORCH_REGRESSION_LOSS_MAP
label_desc: Use image node_id 3 for calling a global function with example usage: loss_creator(config) and returns: getattr