code: def tuple_reduction_helper(
      self, losses, loss_indices, embeddings, labels
  ):
      batch_size = embeddings.shape[0]
      device, dtype = losses.device, losses.dtype
      new_array = torch.zeros(
          batch_size, batch_size, device=device, dtype=dtype
      )
      pos_inf = c_f.pos_inf(dtype)
      new_array += pos_inf
  
      anchors, others = loss_indices
      new_array[anchors, others] = losses
      pos_inf_mask = new_array == pos_inf
      num_inf = torch.sum(pos_inf_mask, dim=1)
  
      new_array[pos_inf_mask] = 0
      num_per_row = batch_size - num_inf
      output = self.aggregation_func(new_array, num_per_row)
  
      loss_dict = {
          "loss": {
              "losses": output,
              "indices": c_f.torch_arange_from_size(embeddings),
              "reduction_type": "element",
          }
      }
      return self.reducer(loss_dict, embeddings, labels)
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/reducers/per_anchor_reducer.py
imports: import torch
  from ..utils import common_functions
  from .base_reducer import BaseReducer
  from .mean_reducer import MeanReducer
label_desc: Use image node_id 3 for calling the PerAnchorReducer obj's underlying member method code with example usage: obj.tuple_reduction_helper(losses, loss_indices, embeddings, labels) and returns: self