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)`.
      valid_ratios (Tensor): 
      word_positions (Tensor): The position of each word.
  Returns:
      Tensor: The output logit sequence 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",")","`",".","valid_ratios","(","Tensor",")",":","word_positions","(","Tensor",")",":","The","position","of","each","word",".","Returns",":","Tensor",":","The","output","logit","sequence","tensor","of","shape",":","math",":","`","(","N",",","T",",","C-1",")","`","."]
code: def forward_test(self, feat, out_enc, 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)`.
          valid_ratios (Tensor):
          word_positions (Tensor): The position of each word.
      Returns:
          Tensor: The output logit sequence tensor of shape
          :math:`(N, T, C-1)`.
      """
      seq_len = self.max_seq_len
      batch_size = feat.shape[0]
  
      decode_sequence = (
          paddle.ones((batch_size, seq_len), dtype="int64")
          * self.start_idx
      )
  
      position_glimpse = self.position_decoder.forward_test(
          feat, out_enc, valid_ratios, word_positions
      )
  
      outputs = []
      for i in range(seq_len):
          hybrid_glimpse_step = self.hybrid_decoder.forward_test_step(
              feat, out_enc, decode_sequence, i, valid_ratios
          )
  
          fusion_out = self.fusion_module(
              hybrid_glimpse_step, position_glimpse[:, i, :]
          )
  
          char_out = self.prediction(fusion_out)
          char_out = F.softmax(char_out, -1)
          outputs.append(char_out)
          max_idx = paddle.argmax(char_out, axis=1, keepdim=False)
          if i < seq_len - 1:
              decode_sequence[:, i + 1] = max_idx
  
      outputs = paddle.stack(outputs, 1)
  
      return outputs
  
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 3 for calling the RobustScannerDecoder obj's underlying member method code with example usage: obj.forward_test(feat, out_enc, valid_ratios, word_positions) and returns: outputs