class_docstr: This factory is used to create task-specific heads for the supported Transformer encoders.
  
  Attributes:
      registry (dict): Dynamic registry mapping task types to task heads
class_docstr_tok: ["This","factory","is","used","to","create","task-specific","heads","for","the","supported","Transformer","encoders",".","Attributes",":","registry","(","dict",")",":","Dynamic","registry","mapping","task","types","to","task","heads"]
docstr: Register each TaskType in task_type_list as a key mapping to a BaseHead task head
  
  Args:
      task_type_list (List[TaskType]): List of TaskTypes that are associated to a
                                       BaseHead task head
  
  Returns:
      Callable: inner_wrapper() wrapping task head constructor or task head factory
code: def register(cls, task_type_list: List[TaskTypes]) -> Callable:
      """Register each TaskType in task_type_list as a key mapping to a BaseHead task head
  
      Args:
          task_type_list (List[TaskType]): List of TaskTypes that are associated to a
                                           BaseHead task head
  
      Returns:
          Callable: inner_wrapper() wrapping task head constructor or task head factory
      """
  
      def inner_wrapper(wrapped_class: BaseHead) -> Callable:
          """Summary
  
          Args:
              wrapped_class (BaseHead): Task head class
  
          Returns:
              Callable: Task head constructor or factory
          """
          for task_type in task_type_list:
              assert task_type not in cls.registry
              cls.registry[task_type] = wrapped_class
          return wrapped_class
  
      return inner_wrapper
  
imports: from __future__ import annotations
  import abc
  import torch
  import torch.nn
  import transformers
  from jiant.ext.allennlp import SelfAttentiveSpanExtractor
  from jiant.shared.model_resolution import ModelArchitectures
  from jiant.tasks.core import TaskTypes
  from typing import Callable
  from typing import List
label_desc: Use image node_id 1 for calling the JiantHeadFactory obj's underlying member method code with example usage: obj.register(cls, task_type_list) and returns: inner_wrapper, wrapped_class