code: def test_forward_train(self):
      # test parallel sar decoder
      loss_cfg = dict(type="CEModuleLoss")
      decoder = ParallelSARDecoder(
          self.dict_cfg,
          module_loss=loss_cfg,
          max_seq_len=self.max_seq_len,
      )
      decoder.init_weights()
      decoder.train()
      feat = torch.rand(2, 512, 4, self.max_seq_len)
      out_enc = torch.rand(2, 512)
      data_samples = decoder.module_loss.get_targets(self.data_info)
      decoder.train_mode = True
      out_train = decoder.forward_train(
          feat, out_enc, data_samples=data_samples
      )
      self.assertEqual(
          out_train.shape, torch.Size([2, self.max_seq_len, 39])
      )
  
file_path: mmocr/tests/test_models/test_textrecog/test_decoders/test_sar_decoder.py
imports: from unittest import TestCase
  import torch
  from mmengine.structures import LabelData
  from mmocr.models.textrecog.decoders import ParallelSARDecoder, SequentialSARDecoder
  from mmocr.structures import TextRecogDataSample
label_desc: Use image node_id 3 for calling the TestParallelSARDecoder obj's underlying member method code with example usage: obj.test_forward_train() without return types