code: def test_swav_soft_distillation(self) -> None:
      with in_temporary_directory() as pretrain_dir:
          # Run a pre-training to have some weights to being with
          pretrain_config = self._create_swav_pretraining_config(
              num_gpu=2
          )
          run_integration_test(pretrain_config)
          checkpoint_path = os.path.join(
              pretrain_dir, "checkpoint.torch"
          )
  
          # Distillation, using 1 crop on the teacher side
          with in_temporary_directory():
              distill_config = (
                  self._create_soft_swav_distillation_config(
                      checkpoint_path=checkpoint_path, num_gpu=2
                  )
              )
              distill_config.LOSS.swav_distillation_loss.normalize_student_feats = (
                  False
              )
              result = run_integration_test(distill_config)
              losses = result.get_losses()
              print(losses)
              self.assertTrue(10, len(losses))
              self.assertGreater(losses[0], losses[-1])
  
          # Distillation, using 2 crops on the teacher side
          with in_temporary_directory():
              distill_config = (
                  self._create_soft_swav_distillation_config(
                      checkpoint_path=checkpoint_path, num_gpu=2
                  )
              )
              distill_config.LOSS.swav_distillation_loss.normalize_student_feats = (
                  False
              )
              distill_config.LOSS.swav_distillation_loss.use_two_crops_for_teacher = (
                  True
              )
              distill_config.LOSS.swav_distillation_loss.swapped_assignment = (
                  True
              )
              result = run_integration_test(distill_config)
              losses = result.get_losses()
              print(losses)
              self.assertTrue(10, len(losses))
              self.assertGreater(losses[0], losses[-1])
  
          # Distillation:
          # - using 2 crops on the teacher side
          # - without SHK
          # - without teacher prototypes
          with in_temporary_directory():
              distill_config = (
                  self._create_soft_swav_distillation_config(
                      checkpoint_path=checkpoint_path, num_gpu=2
                  )
              )
              distill_config.MODEL.HEAD.PARAMS[0][1]["dims"][2] = 3000
              distill_config.LOSS.swav_distillation_loss.normalize_student_feats = (
                  False
              )
              distill_config.LOSS.swav_distillation_loss.use_teacher_prototypes = (
                  False
              )
              distill_config.LOSS.swav_distillation_loss.use_two_crops_for_teacher = (
                  True
              )
              distill_config.LOSS.swav_distillation_loss.swapped_assignment = (
                  False
              )
  
              result = run_integration_test(distill_config)
              losses = result.get_losses()
              print(losses)
              self.assertTrue(10, len(losses))
              self.assertGreater(losses[0], losses[-1])
  
          # Distillation, using normalisation of student output features
          with in_temporary_directory():
              distill_config = (
                  self._create_soft_swav_distillation_config(
                      checkpoint_path=checkpoint_path, num_gpu=2
                  )
              )
              distill_config.LOSS.swav_distillation_loss.normalize_student_feats = (
                  True
              )
              result = run_integration_test(distill_config)
              losses = result.get_losses()
              print(losses)
              self.assertTrue(10, len(losses))
              self.assertGreater(losses[0], losses[-1])
  
imports: import os
  import unittest
  import torch
  import torch.nn.functional
  from vissl.losses.swav_distillation_loss import SwAVDistillationCriterion
  from vissl.losses.swav_loss import SwAVCriterion
  from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict
  from vissl.utils.test_utils import gpu_test, in_temporary_directory, run_integration_test, spawn_distributed_test
label_desc: Use image node_id 13 for calling the TestDistillationSwAV obj's underlying member method code with example usage: obj.test_swav_soft_distillation() without return types