class_docstr: Base decoder for text recognition, build the loss and postprocessor.
  
  Args:
      dictionary (dict or :obj:`Dictionary`): The config for `Dictionary` or
          the instance of `Dictionary`.
      loss (dict, optional): Config to build loss. Defaults to None.
      postprocessor (dict, optional): Config to build postprocessor.
          Defaults to None.
      max_seq_len (int): Maximum sequence length. The
          sequence is usually generated from decoder. Defaults to 40.
      init_cfg (dict or list[dict], optional): Initialization configs.
          Defaults to None.
docstr: Decoder forward.
  
   Args:
      feat (Tensor, optional): Features from the backbone. Defaults
          to None.
      out_enc (Tensor, optional): Features from the encoder.
          Defaults to None.
      data_samples (list[TextRecogDataSample]): A list of N datasamples,
          containing meta information and gold annotations for each of
          the images. Defaults to None.
  
  Returns:
      Tensor: Features from ``decoder`` forward.
docstr_tok: ["Decoder","forward",".","Args",":","feat","(","Tensor",",","optional",")",":","Features","from","the","backbone",".","Defaults","to","None",".","out_enc","(","Tensor",",","optional",")",":","Features","from","the","encoder",".","Defaults","to","None",".","data_samples","(","list","[","TextRecogDataSample","]",")",":","A","list","of","N","datasamples",",","containing","meta","information","and","gold","annotations","for","each","of","the","images",".","Defaults","to","None",".","Returns",":","Tensor",":","Features","from","``","decoder","``","forward","."]
code: def forward(
      self,
      feat: Optional[torch.Tensor] = None,
      out_enc: Optional[torch.Tensor] = None,
      data_samples: Optional[Sequence[TextRecogDataSample]] = None,
  ) -> torch.Tensor:
      """Decoder forward.
  
       Args:
          feat (Tensor, optional): Features from the backbone. Defaults
              to None.
          out_enc (Tensor, optional): Features from the encoder.
              Defaults to None.
          data_samples (list[TextRecogDataSample]): A list of N datasamples,
              containing meta information and gold annotations for each of
              the images. Defaults to None.
  
      Returns:
          Tensor: Features from ``decoder`` forward.
      """
      if self.training:
          if getattr(self, "module_loss") is not None:
              data_samples = self.module_loss.get_targets(data_samples)
          return self.forward_train(feat, out_enc, data_samples)
      else:
          return self.forward_test(feat, out_enc, data_samples)
  
file_path: mmocr/mmocr/models/textrecog/decoders/base.py
imports: from typing import Dict, List, Optional, Sequence, Union
  import torch
  from mmengine.model import BaseModule
  from mmocr.models.common.dictionary import Dictionary
  from mmocr.registry import MODELS, TASK_UTILS
  from mmocr.structures import TextRecogDataSample
label_desc: Use image node_id 6 for calling the BaseDecoder obj's underlying member method code with example usage: obj.forward(feat, out_enc, data_samples) and returns: self, self