code: def forward(ctx, config, inputs, targets):
      cuda_module = transformer_cuda_module
      forward_func = (
          cuda_module.cross_entropy_layer_fw_fp16
          if config.fp16
          else cuda_module.cross_entropy_layer_fw_fp32
      )
  
      targets = targets.to(torch.int32)
      if config.fp16:
          inputs = inputs.to(torch.half)
  
      (reduced_loss, nll_loss) = forward_func(
          config.layer_id, inputs, targets
      )
  
      if config.is_grad_enabled and config.training:
          ctx.save_for_backward(inputs, targets)
          ctx.config = config
      return reduced_loss, nll_loss
  
file_path: lightseq/lightseq/training/ops/pytorch/cross_entropy_layer.py
imports: from dataclasses import dataclass
  import torch
  from torch import nn
  from torch.autograd import Function
  from lightseq.training.ops.pytorch.builder import TransformerBuilder
label_desc: Use image node_id 1 for calling the LSCrossEntropyFunc obj's underlying member method code with example usage: obj.forward(ctx, config, inputs, targets) and returns: reduced_loss,  nll_loss