class_docstr: Implements the point cross entropy loss function.
  
  The original article refers to
  Kirillov A, Wu Y, He K, et al. "PointRend: Image Segmentation As Rendering."
  (https://arxiv.org/abs/1912.08193).
  
  Args:
      weight (tuple|list|ndarray|Tensor, optional): A manual rescaling weight
          given to each class. Its length must be equal to the number of classes.
          Default ``None``.
      ignore_index (int64, optional): Specifies a target value that is ignored
          and does not contribute to the input gradient. Default ``255``.
      top_k_percent_pixels (float, optional): the value lies in [0.0, 1.0]. When its value < 1.0, only compute the loss for
          the top k percent pixels (e.g., the top 20% pixels). This is useful for hard pixel mining. Default ``1.0``.
      data_format (str, optional): The tensor format to use, 'NCHW' or 'NHWC'. Default ``'NCHW'``.
code: def __init__(
      self,
      weight=None,
      ignore_index=255,
      top_k_percent_pixels=1.0,
      data_format="NCHW",
      align_corners=False,
  ):
      super(PointCrossEntropyLoss, self).__init__()
      if weight is not None:
          weight = paddle.to_tensor(weight, dtype="float32")
      self.weight = weight
      self.ignore_index = ignore_index
      self.top_k_percent_pixels = top_k_percent_pixels
      self.EPS = 1e-8
      self.data_format = data_format
      self.align_corners = align_corners
  
file_path: PaddleSeg/paddleseg/models/losses/point_cross_entropy_loss.py
imports: import paddle
  from paddle import nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
label_desc: Use image node_id 1 to create a new PointCrossEntropyLoss object from inherited base classes: nn with example: obj = PointCrossEntropyLoss(weight, ignore_index, top_k_percent_pixels, data_format, align_corners)