code: def test_pytorch_loss(self) -> None:
      cfg = SSLHydraConfig.from_configs(
          [
              "config=test/integration_test/quick_simclr",
              "config.LOSS.name=CosineEmbeddingLoss",
              "+config.LOSS.CosineEmbeddingLoss.margin=1.0",
              "config.DATA.TRAIN.DATA_SOURCES=[synthetic]",
              "config.DATA.TEST.DATA_SOURCES=[synthetic]",
          ]
      )
      _, config = convert_to_attrdict(cfg.default_cfg)
      task = SelfSupervisionTask.from_config(config)
      task.datasets, _ = task.build_datasets()
      self.assertTrue(task._build_loss(), "failed to build loss")
  
file_path: vissl/tests/test_losses_config.py
imports: import logging
  import unittest
  from collections import namedtuple
  from classy_vision.generic.distributed_util import set_cpu_device
  from utils import ROOT_LOSS_CONFIGS, SSLHydraConfig
  from vissl.trainer.train_task import SelfSupervisionTask
  from vissl.utils.hydra_config import convert_to_attrdict, hydra_compose
  from vissl.utils.test_utils import parameterized_parallel
label_desc: Use image node_id 2 for calling the TestRootConfigsLossesBuild obj's underlying member method code with example usage: obj.test_pytorch_loss() without return types