colossalai.nn.loss.loss_3d
- class colossalai.nn.loss.loss_3d.CrossEntropyLoss3D(reduction=True, *args, **kwargs)[source]
Cross entropy loss for 3D parallelism.
- Parameters
reduction (bool, optional) – whether to average the loss, defaults to True.
The
argsandkwargsshould include parameters below:weight (Tensor, optional) size_average (bool, optional) ignore_index (int, optional) reduce (bool, optional) label_smoothing (float, optional)
More details about
args,kwargsandtorch.nn.functional.cross_entropycould be found in Cross_entropy.