class_docstr: Loss used in iBOT (https://arxiv.org/pdf/2111.07832.pdf)
  
  Mostly copy-pasted from the official iBOT repository:
  https://github.com/bytedance/ibot/blob/da316d82636a7a7356835ef224b13d5f3ace0489/main_ibot.py#L478
docstr: Update center used for teacher output.
docstr_tok: ["Update","center","used","for","teacher","output","."]
code: def update_center(self, teacher_cls, teacher_patch):
      """
      Update center used for teacher output.
      """
      cls_center = torch.sum(teacher_cls, dim=0, keepdim=True)
      dist.all_reduce(cls_center)
      cls_center = cls_center / (
          len(teacher_cls) * dist.get_world_size()
      )
      self.center = self.center * self.center_momentum + cls_center * (
          1 - self.center_momentum
      )
  
      patch_center = torch.sum(
          teacher_patch.mean(1), dim=0, keepdim=True
      )
      dist.all_reduce(patch_center)
      patch_center = patch_center / (
          len(teacher_patch) * dist.get_world_size()
      )
      self.center2 = (
          self.center2 * self.center_momentum2
          + patch_center * (1 - self.center_momentum2)
      )
  
imports: import logging
  import pprint
  from typing import List
  import numpy
  import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
  from classy_vision.losses import ClassyLoss, register_loss
  from fairscale.nn import FullyShardedDataParallel
  from vissl.config import AttrDict
  from vissl.models.model_helpers import get_no_ddp_model
  from vissl.utils.distributed_utils import concat_all_gather
label_desc: Use image node_id 3 for calling the iBOTCriterion obj's underlying member method code with example usage: obj.update_center(teacher_cls, teacher_patch) without return types