code: def element_reduction_helper(self, losses, embeddings):
      low_condition, high_condition = None, None
      if self.low is not None:
          low_condition = losses > self.low
          losses = losses[low_condition]
      if self.high is not None:
          high_condition = losses < self.high
          losses = losses[high_condition]
      num_past_filter = len(losses)
      if num_past_filter >= 1:
          loss = torch.mean(losses)
      else:
          loss = self.zero_loss(embeddings)
      self.set_stats(low_condition, high_condition, num_past_filter)
      return loss
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/reducers/threshold_reducer.py
imports: import torch
  from .base_reducer import BaseReducer
label_desc: Use image node_id 6 for calling the ThresholdReducer obj's underlying member method code with example usage: obj.element_reduction_helper(losses, embeddings) and returns: loss