class_docstr: A wrapper class for any loss module to add with auxiliary loss.
  
  Args:
      aux_weight (float): Weight of auxiliary loss in total loss.
      loss_fn (``Callable``): Loss function.
      args (list): Args in loss function.
      kwargs (dict): Kwargs in loss function
class_docstr_tok: ["A","wrapper","class","for","any","loss","module","to","add","with","auxiliary","loss",".","Args",":","aux_weight","(","float",")",":","Weight","of","auxiliary","loss","in","total","loss",".","loss_fn","(","``","Callable","``",")",":","Loss","function",".","args","(","list",")",":","Args","in","loss","function",".","kwargs","(","dict",")",":","Kwargs","in","loss","function"]
code: def __init__(self, aux_weight: float, loss_fn, *args, **kwargs):
      super().__init__()
      self.loss_fn = loss_fn(*args, **kwargs)
      self.aux_weight = aux_weight
  
file_path: ColossalAI/colossalai/moe/loss.py
imports: import torch.nn
  from torch.nn.modules.loss import _Loss
  from colossalai.moe.manager import MOE_MANAGER
label_desc: Use image node_id 1 to create a new MoeLoss object from inherited base classes: _Loss with example: obj = MoeLoss(aux_weight, loss_fn)