code: def invariance_loss(self, emb, ref_emb):
      return torch.mean((emb - ref_emb) ** 2, dim=1)
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/losses/vicreg_loss.py
imports: import torch
  import torch.nn.functional
  from ..utils import common_functions
  from .base_metric_loss_function import BaseMetricLossFunction
label_desc: Use image node_id 3 for calling the VICRegLoss obj's underlying member method code with example usage: obj.invariance_loss(emb, ref_emb) and returns: torch