docstr: Forward pass with momentum network. We forward momentum teacher
  only on the large resolution crops.
docstr_tok: ["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)
  
      # Compute momentum teacher features
      im_k = [
          task.last_batch.sample["input"][i]
          for i in task.loss.crops_for_teacher
      ]
      task.loss.teacher_output = task.loss.momentum_teacher(im_k)[0][-1]
      self.update_teacher_temperature(task)
  
file_path: vissl/vissl/hooks/dino_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 4 for calling the DINOHook obj's underlying member method code with example usage: obj.on_forward(task) without return types