code: def test_encoder(self):
      nrtr_backbone = NRTRModalityTransform()
      nrtr_backbone.init_weights()
      nrtr_backbone.train()
      out_enc = nrtr_backbone(self.img)
      self.assertEqual(out_enc.shape, torch.Size([2, 512, 1, 25]))
  
imports: import unittest
  import torch
  from mmocr.models.textrecog.backbones import NRTRModalityTransform
label_desc: Use image node_id 2 for calling the TestNRTRBackbone obj's underlying member method code with example usage: obj.test_encoder() without return types