class_docstr: Class to implement a Self-Supervised model.
  The model is split into `trunk' that computes features and `head' that
  computes outputs (projections, classifications etc)
  
  This class supports many use cases:
  1. Model producing single output as in standard supervised ImageNet training
  2. Model producing multiple outputs (Multi-task)
  3. Model producing multiple outputs from different features (layers)
     from the trunk (useful in linear evaluation of features from several model layers)
  4. Model that accepts multiple inputs (e.g. image and patches as in PIRL appraoch).
  5. Model where the trunk is frozen.
  6. Model that supports multiple resolutions inputs as in SwAV
  
  * How to specify heads?
      For information on heads see the `_get_heads()` function
  
  * What inputs do `heads' operate on?
      One can specify the `input' to heads mapping in the list
      MULTI_INPUT_HEAD_MAPPING. See the _setup_multi_input_head_mapping()
      function for details.
class_docstr_tok: ["Class","to","implement","a","Self-Supervised","model",".","The","model","is","split","into","`","trunk","'","that","computes","features","and","`","head","'","that","computes","outputs","(","projections",",","classifications","etc",")","This","class","supports","many","use","cases",":","1",".","Model","producing","single","output","as","in","standard","supervised","ImageNet","training","2",".","Model","producing","multiple","outputs","(","Multi-task",")","3",".","Model","producing","multiple","outputs","from","different","features","(","layers",")","from","the","trunk","(","useful","in","linear","evaluation","of","features","from","several","model","layers",")","4",".","Model","that","accepts","multiple","inputs","(","e.g",".","image","and","patches","as","in","PIRL","appraoch",")",".","5",".","Model","where","the","trunk","is","frozen",".","6",".","Model","that","supports","multiple","resolutions","inputs","as","in","SwAV","*","How","to","specify","heads","?","For","information","on","heads","see","the","`","_get_heads","(",")","`","function","*","What","inputs","do","`","heads","'","operate","on","?","One","can","specify","the","`","input","'","to","heads","mapping","in","the","list","MULTI_INPUT_HEAD_MAPPING",".","See","the","_setup_multi_input_head_mapping","(",")","function","for","details","."]
docstr: Construct the model trunk given the architecture specified
  
  The trunks could be convnet (AlexNet, ResNe(X)t, RegNet,...etc), transformers etc.
docstr_tok: ["Construct","the","model","trunk","given","the","architecture","specified","The","trunks","could","be","convnet","(","AlexNet",",","ResNe","(","X",")","t",",","RegNet",",","...","etc",")",",","transformers","etc","."]
code: def _get_trunk(self):
      """
      Construct the model trunk given the architecture specified
  
      The trunks could be convnet (AlexNet, ResNe(X)t, RegNet,...etc), transformers etc.
      """
      # if we are going to evaluate trunk only we shift to feature extractor backbone
      if is_feature_extractor_model(self.model_config):
          self.eval_mode = True
          return FeatureExtractorModel(self.model_config)
      else:
          self.eval_mode = False
          trunk_name = self.model_config.TRUNK.NAME
          return get_model_trunk(trunk_name)(
              self.model_config, trunk_name
          )
  
imports: import copy
  import logging
  from typing import Any, Dict, Iterable, List, Union
  import torch
  import torch.nn
  from classy_vision.models import ClassyModel, ClassyModelHeadExecutorWrapper
  from fairscale.nn.data_parallel import FullyShardedDataParallel
  from vissl.config import AttrDict
  from vissl.data.collators.collator_helper import MultiDimensionalTensor
  from vissl.models import register_model
  from vissl.models.heads import get_model_head, SwAVPrototypesHead
  from vissl.models.model_helpers import get_trunk_output_feature_names, is_feature_extractor_model
  from vissl.models.multiple_input_mapping import MultipleInputMapping
  from vissl.models.trunks import get_model_trunk
  from vissl.models.trunks.feature_extractor import FeatureExtractorModel
  from vissl.utils.checkpoint import CheckpointLoader, init_model_from_consolidated_weights, should_init_head_weights
  from vissl.utils.env import get_machine_local_and_dist_rank
  from vissl.utils.fsdp_utils import fsdp_recursive_reset_lazy_init
  from vissl.utils.misc import set_torch_seed
label_desc: Use image node_id 12 for calling the BaseSSLMultiInputOutputModel obj's underlying member method code with example usage: obj._get_trunk() and returns: FeatureExtractorModel, get_model_trunk