class_docstr: Hook used to have a teacher model run in parallel of a student model
  in order to perform distillation of the teacher to the student
  
  The hook contains the teacher model: it runs in evaluation mode and
  provides the soft labels needed to compute the loss of the student
  
  The hook supports FSDP options to shard the teacher model and avoid
  GPU out of memory due to large models
class_docstr_tok: ["Hook","used","to","have","a","teacher","model","run","in","parallel","of","a","student","model","in","order","to","perform","distillation","of","the","teacher","to","the","student","The","hook","contains","the","teacher","model",":","it","runs","in","evaluation","mode","and","provides","the","soft","labels","needed","to","compute","the","loss","of","the","student","The","hook","supports","FSDP","options","to","shard","the","teacher","model","and","avoid","GPU","out","of","memory","due","to","large","models"]
code: def _initialize_teacher(self):
      fake_config = AttrDict({"MODEL": self.teacher_config})
      checkpoint = self._load_teacher_checkpoint()
      self.teacher.init_model_from_weights_params_file(
          config=fake_config, checkpoint=checkpoint, strict=True
      )
  
imports: import logging
  from typing import Optional
  import torch
  import torch.nn
  from classy_vision import tasks
  from classy_vision.hooks.classy_hook import ClassyHook
  from fairscale.nn import FullyShardedDataParallel
  from vissl.config.attr_dict import AttrDict
  from vissl.losses.dino_distillation_loss import DINODistillationLoss
  from vissl.losses.distillation_loss import DistillationLoss
  from vissl.losses.ibot_distillation_loss import IBOTDistillationLoss
  from vissl.losses.msn_distillation_loss import MSNDistillationLoss
  from vissl.losses.swav_distillation_loss import SwAVDistillationLoss
  from vissl.models import build_model
  from vissl.utils.checkpoint import CheckpointLoader
  from vissl.utils.fsdp_utils import fsdp_wrapper
label_desc: Use image node_id 5 for calling the DistillationHook obj's underlying member method code with example usage: obj._initialize_teacher() without return types