class_docstr: Hook used for the implementation of iBOT (https://arxiv.org/pdf/2111.07832.pdf)
  - Handles the creation of the EMA teacher
  - Handles the forward of the EMA teacher
  - Handles the configuration of the DINO Loss
docstr: Forward pass with momentum network. We forward momentum teacher
  only on the large resolution crops.
code: def on_forward(self, task: tasks.ClassyTask) -> None:
      """
      Forward pass with momentum network. We forward momentum teacher
      only on the large resolution crops.
      """
  
      # Create the momentum teacher and its center if this is the first forward of a run
      if task.loss.momentum_teacher is None:
          self._build_momentum_network(task)
  
      # From the student inputs, only keep the global views
      # - ignore the local views
      # - ignore the mask for the global views
      last_student_input = task.last_batch.sample["input"]
      teacher_input = {
          "global_views": last_student_input["global_views"]
      }
  
      # Compute momentum teacher features
      teacher_output = task.loss.momentum_teacher(teacher_input)
      task.loss.teacher_output = teacher_output[0]
      task.loss.set_current_epoch(task.train_phase_idx)
  
file_path: vissl/vissl/hooks/ibot_hooks.py
imports: import torch
  from classy_vision import tasks
  from classy_vision.hooks.classy_hook import ClassyHook
  from vissl.hooks.hook_utils import MomentumTeacherInLossHook
label_desc: Use image node_id 3 for calling the IBOTHook obj's underlying member method code with example usage: obj.on_forward(task) without return types