code: def test_forward(self):
      encoder = SAREncoder()
      encoder.init_weights()
      encoder.train()
  
      feat = torch.randn(2, 512, 4, 40)
      with self.assertRaises(AssertionError):
          encoder(feat, self.data_info * 2)
      out_enc = encoder(feat, self.data_info)
      self.assertEqual(out_enc.shape, torch.Size([2, 512]))
  
file_path: mmocr/tests/test_models/test_textrecog/test_encoders/test_sar_encoder.py
imports: from unittest import TestCase
  import torch
  from mmocr.models.textrecog.encoders import SAREncoder
  from mmocr.structures import TextRecogDataSample
label_desc: Use image node_id 3 for calling the TestSAREncoder obj's underlying member method code with example usage: obj.test_forward() without return types