docstr: Args:
      embeddings: tensor of size (batch_size, embedding_size)
      labels: tensor of size (batch_size)
      indices_tuple: tuple of size 3 for triplets (anchors, positives, negatives)
                      or size 4 for pairs (anchor1, postives, anchor2, negatives)
                      Can also be left as None
  Returns: the loss
docstr_tok: ["Args",":","embeddings",":","tensor","of","size","(","batch_size",",","embedding_size",")","labels",":","tensor","of","size","(","batch_size",")","indices_tuple",":","tuple","of","size","3","for","triplets","(","anchors",",","positives",",","negatives",")","or","size","4","for","pairs","(","anchor1",",","postives",",","anchor2",",","negatives",")","Can","also","be","left","as","None","Returns",":","the","loss"]
code: def forward(
      self,
      embeddings,
      labels=None,
      indices_tuple=None,
      ref_emb=None,
      ref_labels=None,
  ):
      """
      Args:
          embeddings: tensor of size (batch_size, embedding_size)
          labels: tensor of size (batch_size)
          indices_tuple: tuple of size 3 for triplets (anchors, positives, negatives)
                          or size 4 for pairs (anchor1, postives, anchor2, negatives)
                          Can also be left as None
      Returns: the loss
      """
      self.reset_stats()
      c_f.check_shapes(embeddings, labels)
      if labels is not None:
          labels = c_f.to_device(labels, embeddings)
      ref_emb, ref_labels = c_f.set_ref_emb(
          embeddings, labels, ref_emb, ref_labels
      )
      loss_dict = self.compute_loss(
          embeddings, labels, indices_tuple, ref_emb, ref_labels
      )
      self.add_embedding_regularization_to_loss_dict(
          loss_dict, embeddings
      )
      return self.reducer(loss_dict, embeddings, labels)
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/losses/base_metric_loss_function.py
imports: import inspect
  from ..utils import common_functions
  from ..utils.module_with_records_and_reducer import ModuleWithRecordsReducerAndDistance
  from .mixins import EmbeddingRegularizerMixin
label_desc: Use image node_id 2 for calling the BaseMetricLossFunction obj's underlying member method code with example usage: obj.forward(embeddings, labels, indices_tuple, ref_emb, ref_labels) and returns: self