docstr: Args:
      inputs (Tensor): Shape of :math:`(N, C, H, W)`.
      gt_comp_attribs (list[ndarray]): The padded text component
          attributes. Shape: (num_component, 8).
  
  Returns:
      tuple: Returns (pred_maps, (gcn_pred, gt_labels)).
  
          - | pred_maps (Tensor): Prediction map with shape
              :math:`(N, C_{out}, H, W)`.
          - | gcn_pred (Tensor): Prediction from GCN module, with
              shape :math:`(N, 2)`.
          - | gt_labels (Tensor): Ground-truth label with shape
              :math:`(N, 8)`.
docstr_tok: ["Args",":","inputs","(","Tensor",")",":","Shape","of",":","math",":","`","(","N",",","C",",","H",",","W",")","`",".","gt_comp_attribs","(","list","[","ndarray","]",")",":","The","padded","text","component","attributes",".","Shape",":","(","num_component",",","8",")",".","Returns",":","tuple",":","Returns","(","pred_maps",",","(","gcn_pred",",","gt_labels",")",")",".","-","|","pred_maps","(","Tensor",")",":","Prediction","map","with","shape",":","math",":","`","(","N",",","C_","{","out","}",",","H",",","W",")","`",".","-","|","gcn_pred","(","Tensor",")",":","Prediction","from","GCN","module",",","with","shape",":","math",":","`","(","N",",","2",")","`",".","-","|","gt_labels","(","Tensor",")",":","Ground-truth","label","with","shape",":","math",":","`","(","N",",","8",")","`","."]
code: def forward(self, inputs, targets=None):
      """
      Args:
          inputs (Tensor): Shape of :math:`(N, C, H, W)`.
          gt_comp_attribs (list[ndarray]): The padded text component
              attributes. Shape: (num_component, 8).
  
      Returns:
          tuple: Returns (pred_maps, (gcn_pred, gt_labels)).
  
              - | pred_maps (Tensor): Prediction map with shape
                  :math:`(N, C_{out}, H, W)`.
              - | gcn_pred (Tensor): Prediction from GCN module, with
                  shape :math:`(N, 2)`.
              - | gt_labels (Tensor): Ground-truth label with shape
                  :math:`(N, 8)`.
      """
      if self.training:
          assert targets is not None
          gt_comp_attribs = targets[7]
          pred_maps = self.out_conv(inputs)
          feat_maps = paddle.concat([inputs, pred_maps], axis=1)
          (
              node_feats,
              adjacent_matrices,
              knn_inds,
              gt_labels,
          ) = self.graph_train(feat_maps, np.stack(gt_comp_attribs))
  
          gcn_pred = self.gcn(node_feats, adjacent_matrices, knn_inds)
  
          return pred_maps, (gcn_pred, gt_labels)
      else:
          return self.single_test(inputs)
  
file_path: PaddleOCR/ppocr/modeling/heads/det_drrg_head.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import warnings
  import cv2
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from .gcn import GCN
  from .local_graph import LocalGraphs
  from .proposal_local_graph import ProposalLocalGraphs
label_desc: Use image node_id 2 for calling the DRRGHead obj's underlying member method code with example usage: obj.forward(inputs, targets) and returns: pred_maps,  gcn_pred,  gt_labels, self