code: def __init__(
      self,
      in_channels,
      hidden_size,
      in_max_len=488,
      max_text_length=800,
      out_channels=30,
      loc_reg_num=4,
      **kwargs,
  ):
      super(TableAttentionHead, self).__init__()
      self.input_size = in_channels[-1]
      self.hidden_size = hidden_size
      self.out_channels = out_channels
      self.max_text_length = max_text_length
  
      self.structure_attention_cell = AttentionGRUCell(
          self.input_size, hidden_size, self.out_channels, use_gru=False
      )
      self.structure_generator = nn.Linear(
          hidden_size, self.out_channels
      )
      self.in_max_len = in_max_len
  
      if self.in_max_len == 640:
          self.loc_fea_trans = nn.Linear(400, self.max_text_length + 1)
      elif self.in_max_len == 800:
          self.loc_fea_trans = nn.Linear(625, self.max_text_length + 1)
      else:
          self.loc_fea_trans = nn.Linear(256, self.max_text_length + 1)
      self.loc_generator = nn.Linear(
          self.input_size + hidden_size, loc_reg_num
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  import paddle.nn
  from paddle import ParamAttr
  import paddle.nn.functional
  import numpy
  from .rec_att_head import AttentionGRUCell
label_desc: Use image node_id 1 to create a new TableAttentionHead object from inherited base classes: nn with example: obj = TableAttentionHead(in_channels, hidden_size, in_max_len, max_text_length, out_channels, loc_reg_num)