class_docstr: Loss used in MSN (https://arxiv.org/pdf/2204.07141.pdf)
  
  Args:
      temperature (float): temperature
      teacher_momentum (float): controls EMA of teacher
class_docstr_tok: ["Loss","used","in","MSN","(","https",":","\/\/arxiv.org\/pdf\/2204.07141.pdf",")","Args",":","temperature","(","float",")",":","temperature","teacher_momentum","(","float",")",":","controls","EMA","of","teacher"]
docstr: Return the state dictionary for the loss:
  - For DDP model, we rely on the default implementation of PyTorch
  - For FSDP model, we only return a shard of the teacher model and
    each rank will do the same, limiting memory consumption
docstr_tok: ["Return","the","state","dictionary","for","the","loss",":","-","For","DDP","model",",","we","rely","on","the","default","implementation","of","PyTorch","-","For","FSDP","model",",","we","only","return","a","shard","of","the","teacher","model","and","each","rank","will","do","the","same",",","limiting","memory","consumption"]
code: def state_dict(self, destination=None, prefix="", keep_vars=False):
      """
      Return the state dictionary for the loss:
      - For DDP model, we rely on the default implementation of PyTorch
      - For FSDP model, we only return a shard of the teacher model and
        each rank will do the same, limiting memory consumption
      """
      if isinstance(self.momentum_teacher, FullyShardedDataParallel):
          return {
              "teacher": self.momentum_teacher.local_state_dict(),
              "teacher_meta": self.momentum_teacher.local_metadata_dict(),
          }
      else:
          return {"teacher": self.momentum_teacher.state_dict()}
  
file_path: vissl/vissl/losses/msn_loss.py
imports: import logging
  import pprint
  from typing import List
  import torch
  from classy_vision.generic.distributed_util import get_cuda_device_index, is_distributed_training_run
  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
label_desc: Use image node_id 3 for calling the MSNLoss obj's underlying member method code with example usage: obj.state_dict(destination, prefix, keep_vars) and returns: dict, dict