code: def __init__(
      self,
      in_channels,
      out_channels,
      enc_dim=512,
      max_text_length=30,
      enc_bi_rnn=False,
      enc_drop_rnn=0.1,
      enc_gru=False,
      dec_bi_rnn=False,
      dec_drop_rnn=0.0,
      dec_gru=False,
      d_k=512,
      pred_dropout=0.1,
      pred_concat=True,
      **kwargs,
  ):
      super(SARHead, self).__init__()
  
      # encoder module
      self.encoder = SAREncoder(
          enc_bi_rnn=enc_bi_rnn,
          enc_drop_rnn=enc_drop_rnn,
          enc_gru=enc_gru,
          d_model=in_channels,
          d_enc=enc_dim,
      )
  
      # decoder module
      self.decoder = ParallelSARDecoder(
          out_channels=out_channels,
          enc_bi_rnn=enc_bi_rnn,
          dec_bi_rnn=dec_bi_rnn,
          dec_drop_rnn=dec_drop_rnn,
          dec_gru=dec_gru,
          d_model=in_channels,
          d_enc=enc_dim,
          d_k=d_k,
          pred_dropout=pred_dropout,
          max_text_length=max_text_length,
          pred_concat=pred_concat,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
label_desc: Use image node_id 1 to create a new SARHead object from inherited base classes: nn with example: obj = SARHead(in_channels, out_channels, enc_dim, max_text_length, enc_bi_rnn, enc_drop_rnn, enc_gru, dec_bi_rnn, dec_drop_rnn, dec_gru, d_k, pred_dropout, pred_concat)