class_docstr: Decoder for RobustScanner.
  
  RobustScanner: `RobustScanner: Dynamically Enhancing Positional Clues for
  Robust Text Recognition <https://arxiv.org/abs/2007.07542>`_
  
  Args:
      num_classes (int): Number of output classes :math:`C`.
      dim_input (int): Dimension :math:`D_i` of input vector ``feat``.
      dim_model (int): Dimension :math:`D_m` of the model. Should also be the
          same as encoder output vector ``out_enc``.
      max_seq_len (int): Maximum output sequence length :math:`T`.
      start_idx (int): The index of `<SOS>`.
      mask (bool): Whether to mask input features according to
          ``img_meta['valid_ratio']``.
      padding_idx (int): The index of `<PAD>`.
      encode_value (bool): Whether to use the output of encoder ``out_enc``
          as `value` of attention layer. If False, the original feature
          ``feat`` will be used.
  
  Warning:
      This decoder will not predict the final class which is assumed to be
      `<PAD>`. Therefore, its output size is always :math:`C - 1`. `<PAD>`
      is also ignored by loss as specified in
      :obj:`mmocr.models.textrecog.recognizer.EncodeDecodeRecognizer`.
docstr: Args:
      feat (Tensor): Tensor of shape :math:`(N, D_i, H, W)`.
      out_enc (Tensor): Encoder output of shape
          :math:`(N, D_m, H, W)`.
      target (dict): A dict with the key ``padded_targets``, a
          tensor of shape :math:`(N, T)`. Each element is the index of a
          character.
      valid_ratios (Tensor): 
      word_positions (Tensor): The position of each word.
  
  Returns:
      Tensor: A raw logit tensor of shape :math:`(N, T, C-1)`.
docstr_tok: ["Args",":","feat","(","Tensor",")",":","Tensor","of","shape",":","math",":","`","(","N",",","D_i",",","H",",","W",")","`",".","out_enc","(","Tensor",")",":","Encoder","output","of","shape",":","math",":","`","(","N",",","D_m",",","H",",","W",")","`",".","target","(","dict",")",":","A","dict","with","the","key","``","padded_targets","``",",","a","tensor","of","shape",":","math",":","`","(","N",",","T",")","`",".","Each","element","is","the","index","of","a","character",".","valid_ratios","(","Tensor",")",":","word_positions","(","Tensor",")",":","The","position","of","each","word",".","Returns",":","Tensor",":","A","raw","logit","tensor","of","shape",":","math",":","`","(","N",",","T",",","C-1",")","`","."]
code: def forward_train(
      self, feat, out_enc, target, valid_ratios, word_positions
  ):
      """
      Args:
          feat (Tensor): Tensor of shape :math:`(N, D_i, H, W)`.
          out_enc (Tensor): Encoder output of shape
              :math:`(N, D_m, H, W)`.
          target (dict): A dict with the key ``padded_targets``, a
              tensor of shape :math:`(N, T)`. Each element is the index of a
              character.
          valid_ratios (Tensor):
          word_positions (Tensor): The position of each word.
  
      Returns:
          Tensor: A raw logit tensor of shape :math:`(N, T, C-1)`.
      """
      hybrid_glimpse = self.hybrid_decoder.forward_train(
          feat, out_enc, target, valid_ratios
      )
      position_glimpse = self.position_decoder.forward_train(
          feat, out_enc, target, valid_ratios, word_positions
      )
  
      fusion_out = self.fusion_module(hybrid_glimpse, position_glimpse)
  
      out = self.prediction(fusion_out)
  
      return out
  
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 2 for calling the RobustScannerDecoder obj's underlying member method code with example usage: obj.forward_train(feat, out_enc, target, valid_ratios, word_positions) and returns: out