code: def test_forward(self):
      loss = PANEmbLossV1()
  
      pred = torch.rand((2, 4, 10, 10))
      gt = torch.rand((2, 10, 10))
      mask = torch.rand((2, 10, 10))
      instance = torch.zeros_like(gt)
      instance[:, 2:4, 2:4] = 1
      instance[:, 6:8, 6:8] = 2
  
      loss_value = loss(pred, instance, gt, mask)
      self.assertEqual(loss_value.shape, torch.Size([2]))
  
      instance = instance = torch.zeros_like(gt)
      loss_value = loss(pred, instance, gt, mask)
      self.assertTrue(
          (loss_value == torch.zeros(2, dtype=torch.float32)).all()
      )
  
file_path: mmocr/tests/test_models/test_textdet/test_module_losses/test_pan_module_loss.py
imports: from unittest import TestCase
  import numpy
  import torch
  import torch.nn
  from mmengine.structures import InstanceData
  from mmocr.models.textdet.module_losses import PANModuleLoss
  from mmocr.models.textdet.module_losses.pan_module_loss import PANEmbLossV1
  from mmocr.structures import TextDetDataSample
label_desc: Use image node_id 1 for calling the TestPANEmbLossV1 obj's underlying member method code with example usage: obj.test_forward() without return types