code: def test_global_loss__compare(self):
      # Compare against original implementation.
      torch.manual_seed(0)
      criterion = VICRegLLoss()
      global_view_features = [
          (torch.randn((2, 32)), torch.randn((2, 7, 7, 8)))
          for _ in range(2)
      ]
      local_view_features = [
          (torch.randn((2, 32)), torch.randn((2, 4, 4, 8)))
          for _ in range(6)
      ]
      loss = criterion._global_loss(
          global_view_features=global_view_features,
          local_view_features=local_view_features,
      )
  
      embedding = [
          x for x, _ in global_view_features + local_view_features
      ]
      expected_loss = _reference_global_loss(embedding=embedding)
      assert loss == expected_loss
  
file_path: lightly/tests/loss/test_VICRegLLoss.py
imports: import unittest
  from typing import List
  import numpy
  import torch
  import torch.nn.functional
  from torch import Tensor
  from lightly.loss import VICRegLLoss
label_desc: Use image node_id 6 for calling the TestVICRegLLoss obj's underlying member method code with example usage: obj.test_global_loss__compare() without return types