code: def test_freeze_encoder(self):
      net = HoVerNet(mode=HoVerNet.Mode.FAST, freeze_encoder=True)
      with train_mode(net):
          for _, param in net.res_blocks[1:].named_parameters():
              self.assertFalse(param.requires_grad)
          for name, param in net.res_blocks[0].named_parameters():
              if param.requires_grad is True:
                  self.assertTrue("bna_block" or "shortcut" in name)
  
file_path: MONAI/tests/test_hovernet.py
imports: from __future__ import annotations
  import unittest
  import torch
  from parameterized import parameterized
  from monai.networks import eval_mode, train_mode
  from monai.networks.nets import HoVerNet
  from monai.networks.nets.hovernet import _DenseLayerDecoder
  from tests.utils import test_script_save
label_desc: Use image node_id 6 for calling the TestHoverNet obj's underlying member method code with example usage: obj.test_freeze_encoder() without return types