class_docstr: CenterFocalLoss is a variant of focal loss.
  
  More details can be found in the `paper
  <https://arxiv.org/abs/1808.01244>`_
  
  Args:
      reduction (str): Options are "none", "mean" and "sum".
      loss_weight (float): Loss weight of current loss.
class_docstr_tok: ["CenterFocalLoss","is","a","variant","of","focal","loss",".","More","details","can","be","found","in","the","`","paper","<","https",":","\/\/arxiv.org\/abs\/1808.01244",">","`","_","Args",":","reduction","(","str",")",":","Options","are","``","none","''",",","``","mean","''","and","``","sum","''",".","loss_weight","(","float",")",":","Loss","weight","of","current","loss","."]
docstr: Forward function.
  
  Args:
      pred (Tensor): The prediction.
      target (Tensor): The learning target of the prediction in gaussian
          distribution.
      weight (Tensor, optional): The weight of loss for each
          prediction. Defaults to None.
      mask (Tensor): The valid mask. Defaults to None.
      avg_factor (int, optional): Average factor that is used to average
          the loss. Defaults to None.
      reduction_override (str, optional): The reduction method used to
          override the original reduction method of the loss.
          Defaults to None.
docstr_tok: ["Forward","function",".","Args",":","pred","(","Tensor",")",":","The","prediction",".","target","(","Tensor",")",":","The","learning","target","of","the","prediction","in","gaussian","distribution",".","weight","(","Tensor",",","optional",")",":","The","weight","of","loss","for","each","prediction",".","Defaults","to","None",".","mask","(","Tensor",")",":","The","valid","mask",".","Defaults","to","None",".","avg_factor","(","int",",","optional",")",":","Average","factor","that","is","used","to","average","the","loss",".","Defaults","to","None",".","reduction_override","(","str",",","optional",")",":","The","reduction","method","used","to","override","the","original","reduction","method","of","the","loss",".","Defaults","to","None","."]
code: def forward(
      self,
      pred,
      target,
      weight=None,
      mask=None,
      avg_factor=None,
      reduction_override=None,
  ):
      """Forward function.
  
      Args:
          pred (Tensor): The prediction.
          target (Tensor): The learning target of the prediction in gaussian
              distribution.
          weight (Tensor, optional): The weight of loss for each
              prediction. Defaults to None.
          mask (Tensor): The valid mask. Defaults to None.
          avg_factor (int, optional): Average factor that is used to average
              the loss. Defaults to None.
          reduction_override (str, optional): The reduction method used to
              override the original reduction method of the loss.
              Defaults to None.
      """
      assert reduction_override in (None, "none", "mean", "sum")
      reduction = (
          reduction_override if reduction_override else self.reduction
      )
      loss_reg = self.loss_weight * center_focal_loss(
          pred,
          target,
          weight,
          mask=mask,
          reduction=reduction,
          avg_factor=avg_factor,
      )
      return loss_reg
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from itertools import cycle, islice
  from collections import abc
  import numpy
  import paddle
  import paddle.nn
  from ppdet.core.workspace import register, serializable
label_desc: Use image node_id 2 for calling the CenterFocalLoss obj's underlying member method code with example usage: obj.forward(pred, target, weight, mask, avg_factor, reduction_override) and returns: loss_reg