code: def test__loss_matches_reference_loss(self) -> None:
      batch_size = 32
      projector_dim = 8196
      lambda_param = 5e-3
      gather_distributed = False
      loss = BarlowTwinsLoss(
          lambda_param=lambda_param,
          gather_distributed=gather_distributed,
      )
      loss_ref = BarlowTwinsLossReference(
          projector_dim=projector_dim,
          lambda_param=lambda_param,
          gather_distributed=gather_distributed,
      )
  
      z_a = torch.randn(batch_size, projector_dim)
      z_b = torch.randn(batch_size, projector_dim)
  
      loss_out = loss(z_a, z_b)
      loss_ref_out = loss_ref(z_a, z_b)
  
      assert torch.allclose(
          loss_out, loss_ref_out, rtol=1e-3, atol=1e-3
      )
  
file_path: lightly/tests/loss/test_barlow_twins_loss.py
imports: import pytest
  import torch
  import torch.nn
  from pytest_mock import MockerFixture
  from torch import distributed
  from lightly.loss.barlow_twins_loss import BarlowTwinsLoss
label_desc: Use image node_id 3 for calling the TestBarlowTwinsLoss obj's underlying member method code with example usage: obj.test__loss_matches_reference_loss() without return types