code: def forward(self, logit, label, mask=None):
      if len(label.shape) == 3:
          label = label.unsqueeze(1)
      if mask is not None:
          if len(mask.shape) == 3:
              mask = mask.unsqueeze(1)
          logit = logit * mask
          label = label * mask
          loss = paddle.sum(
              F.l1_loss(self.sobel(logit), self.sobel(label), "none")
          ) / (mask.sum() + self.eps)
      else:
          loss = F.l1_loss(self.sobel(logit), self.sobel(label), "mean")
  
      return loss
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
  import cv2
label_desc: Use image node_id 2 for calling the GradientLoss obj's underlying member method code with example usage: obj.forward(logit, label, mask) and returns: loss