class_docstr: Wrapper which changes the forward to also execute and return head output.
class_docstr_tok: ["Wrapper","which","changes","the","forward","to","also","execute","and","return","head","output","."]
code: def forward(self, *args, **kwargs):
      out = self.classy_model(*args, **kwargs)
  
      if len(self._heads) == 0:
          return out
  
      # heads have been attached to the model, return their output instead
      head_outputs = self.execute_heads()
      if len(head_outputs) == 1:
          return list(head_outputs.values())[0]
      else:
          return head_outputs
  
imports: import copy
  import types
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  import torch.nn
  from classy_vision.generic.util import log_class_usage
  from classy_vision.heads.classy_head import ClassyHead
  from .classy_block import ClassyBlock
label_desc: Use image node_id 1 for calling the ClassyModelHeadExecutorWrapper obj's underlying member method code with example usage: obj.forward() and returns: out, list, head_outputs