class_docstr: Vocab parallel cross entropy loss for 1D parallelism.
  
  Args:
      reduction (bool, optional): whether to average the loss, defaults to True.
class_docstr_tok: ["Vocab","parallel","cross","entropy","loss","for","1D","parallelism",".","Args",":","reduction","(","bool",",","optional",")",":","whether","to","average","the","loss",",","defaults","to","True","."]
code: def __init__(self, reduction=True):
      super().__init__()
      self.reduction_mean = reduction
  
file_path: ColossalAI/colossalai/legacy/nn/loss/loss_1d.py
imports: import torch
  import torch.distributed
  from torch.cuda.amp import custom_bwd, custom_fwd
  from torch.nn.modules.loss import _Loss
  from colossalai.legacy.context import ParallelMode
  from colossalai.legacy.core import global_context
  from colossalai.legacy.registry import LOSSES
label_desc: Use image node_id 1 to create a new VocabParallelCrossEntropyLoss1D object from inherited base classes: _Loss with example: obj = VocabParallelCrossEntropyLoss1D(reduction)