class_docstr: SPTS Encoder.
  
  Args:
      d_backbone (int): Backbone output dimension.
      d_model (int): Model output dimension.
      init_cfg (dict or list[dict], optional): Initialization configs.
          Defaults to None.
docstr: Forward propagation of encoder.
  
  Args:
      feat (Tensor): Feature tensor of shape :math:`(N, D_m, H, W)`.
      data_samples (list[TextSpottingDataSample]): Batch of
          TextSpottingDataSample.
          Defaults to None.
  
  Returns:
      Tensor: A tensor of shape :math:`(N, T, D_m)`.
docstr_tok: ["Forward","propagation","of","encoder",".","Args",":","feat","(","Tensor",")",":","Feature","tensor","of","shape",":","math",":","`","(","N",",","D_m",",","H",",","W",")","`",".","data_samples","(","list","[","TextSpottingDataSample","]",")",":","Batch","of","TextSpottingDataSample",".","Defaults","to","None",".","Returns",":","Tensor",":","A","tensor","of","shape",":","math",":","`","(","N",",","T",",","D_m",")","`","."]
code: def forward(
      self,
      feat: Tensor,
      data_samples: List[TextSpottingDataSample] = None,
  ) -> Tensor:
      """Forward propagation of encoder.
  
      Args:
          feat (Tensor): Feature tensor of shape :math:`(N, D_m, H, W)`.
          data_samples (list[TextSpottingDataSample]): Batch of
              TextSpottingDataSample.
              Defaults to None.
  
      Returns:
          Tensor: A tensor of shape :math:`(N, T, D_m)`.
      """
      return self.input_proj(feat[0])
  
file_path: mmocr/projects/SPTS/spts/model/spts_encoder.py
imports: from typing import Dict, List, Optional, Union
  import torch.nn
  from torch import Tensor
  from mmocr.models.textrecog.encoders import BaseEncoder
  from mmocr.registry import MODELS
  from mmocr.structures import TextSpottingDataSample
label_desc: Use image node_id 2 for calling the SPTSEncoder obj's underlying member method code with example usage: obj.forward(feat, data_samples) and returns: self