code: def element_reduction_helper(self, losses, indices, labels):
      self.weights = c_f.to_device(
          self.weights, losses, dtype=losses.dtype
      )
      return torch.mean(losses * self.weights[labels[indices]])
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/reducers/class_weighted_reducer.py
imports: import torch
  from ..utils import common_functions
  from .base_reducer import BaseReducer
label_desc: Use image node_id 6 for calling the ClassWeightedReducer obj's underlying member method code with example usage: obj.element_reduction_helper(losses, indices, labels) and returns: torch