code: def test_setter(self):
      recog_data_sample = TextRecogDataSample()
      # test gt_text
      gt_label_data = dict(item="mmocr")
      gt_text = LabelData(**gt_label_data)
      recog_data_sample.gt_text = gt_text
      assert "gt_text" in recog_data_sample
      self.assertEqual(recog_data_sample.gt_text.item, gt_text.item)
  
      # test pred_text
      pred_label_data = dict(item="mmocr")
      pred_text = LabelData(**pred_label_data)
      recog_data_sample.pred_text = pred_text
      assert "pred_text" in recog_data_sample
      self.assertEqual(recog_data_sample.pred_text.item, pred_text.item)
      # test type error
      with self.assertRaises(AssertionError):
          recog_data_sample.gt_text = torch.rand(2, 4)
      with self.assertRaises(AssertionError):
          recog_data_sample.pred_text = torch.rand(2, 4)
  
file_path: mmocr/tests/test_structures/test_textrecog_data_sample.py
imports: from unittest import TestCase
  import numpy
  import torch
  from mmengine.structures import LabelData
  from mmocr.structures import TextRecogDataSample
label_desc: Use image node_id 2 for calling the TestTextRecogDataSample obj's underlying member method code with example usage: obj.test_setter() without return types