code: def test_forward__error_local_view_features_and_grids_must_both_be_set(
      self,
  ) -> None:
      criterion = VICRegLLoss()
      local_view_features = [
          (torch.randn((2, 32)), torch.randn((2, 4, 4, 8)))
          for _ in range(2)
      ]
      local_view_grids = [torch.randn((2, 4, 4, 2)) for _ in range(2)]
      error_msg = (
          "local_view_features and local_view_grids must either both be set or None "
          "but found <class 'list'> and <class 'NoneType'>."
      )
      with self.assertRaisesRegex(ValueError, error_msg):
          criterion.forward(
              global_view_features=[],
              global_view_grids=[],
              local_view_features=local_view_features,
              local_view_grids=None,
          )
  
      error_msg = (
          "local_view_features and local_view_grids must either both be set or None "
          "but found <class 'NoneType'> and <class 'list'>."
      )
      with self.assertRaisesRegex(ValueError, error_msg):
          criterion.forward(
              global_view_features=[],
              global_view_grids=[],
              local_view_features=None,
              local_view_grids=local_view_grids,
          )
  
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 5 for calling the TestVICRegLLoss obj's underlying member method code with example usage: obj.test_forward__error_local_view_features_and_grids_must_both_be_set() without return types