code: def test_head_execution(self):
      # test head outputs without any extra wrapper logic, which is the case with
      # no wrappers or the base ClassyModelWrapper class
      for wrapper_class in [None, ClassyModelWrapper]:
          self.DummyTestModel.wrapper_cls = wrapper_class
          model = self.DummyTestModel()
          head = self.DummyTestHead()
          model.set_heads({"dummy_block2": [head]})
          input = torch.randn(1, 2)
          output = model(input)
          head_output = model.execute_heads()
          self.assertTrue(
              torch.allclose(head(output), head_output["head_id"])
          )
  
      # test that the head output is returned automatically with the
      # ClassyModelHeadExecutorWrapper
      self.DummyTestModel.wrapper_cls = ClassyModelHeadExecutorWrapper
      model = self.DummyTestModel()
      head = self.DummyTestHead()
      model.set_heads({"dummy_block2": [head]})
      input = torch.randn(1, 2)
      output = model(input)
      head_output = model.execute_heads()
      self.assertTrue(torch.allclose(output, head_output["head_id"]))
  
file_path: ClassyVision/test/models_classy_block_test.py
imports: import unittest
  import torch
  import torch.nn
  from classy_vision.heads import ClassyHead
  from classy_vision.models import ClassyModel, ClassyModelHeadExecutorWrapper, ClassyModelWrapper
label_desc: Use image node_id 3 for calling the TestClassyBlock obj's underlying member method code with example usage: obj.test_head_execution() without return types