class_docstr: Specific tests on Barlow Twins going further than just doing a forward pass
class_docstr_tok: ["Specific","tests","on","Barlow","Twins","going","further","than","just","doing","a","forward","pass"]
code: def worker_fn(
      gpu_id: int, world_size: int, batch_size: int, sync_file: str
  ):
      init_distributed_on_file(
          world_size=world_size, gpu_id=gpu_id, sync_file=sync_file
      )
      EMBEDDING_DIM = 128
      criterion = BarlowTwinsCriterion(
          lambda_=0.0051, scale_loss=0.024, embedding_dim=EMBEDDING_DIM
      )
      embeddings = torch.randn(
          (batch_size, EMBEDDING_DIM),
          dtype=torch.float32,
          requires_grad=True,
      ).cuda()
      criterion(embeddings).backward()
  
file_path: vissl/tests/test_losses_gpu.py
imports: import unittest
  import torch
  import torch.multiprocessing
  from vissl.losses.barlow_twins_loss import BarlowTwinsCriterion
  from vissl.losses.simclr_info_nce_loss import SimclrInfoNCECriterion
  from vissl.utils.test_utils import gpu_test, init_distributed_on_file, with_temp_files
label_desc: Use image node_id 1 for calling the TestBarlowTwinsCriterionOnGpu obj's underlying member method code with example usage: obj.worker_fn(gpu_id, world_size, batch_size, sync_file) without return types