code: def set_reducer(self, reducer):
      if isinstance(reducer, (MultipleReducers, DoNothingReducer)):
          self.reducer = reducer
      elif len(self.sub_loss_names()) == 1:
          self.reducer = (
              self.get_default_reducer()
              if reducer is None
              else copy.deepcopy(reducer)
          )
      else:
          reducer_dict = {}
          for k in self.sub_loss_names():
              reducer_dict[k] = (
                  self.get_default_reducer()
                  if reducer is None
                  else copy.deepcopy(reducer)
              )
          self.reducer = MultipleReducers(reducer_dict)
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/utils/module_with_records_and_reducer.py
imports: import copy
  from ..distances import LpDistance
  from ..reducers import DoNothingReducer, MeanReducer, MultipleReducers
  from .module_with_records import ModuleWithRecords
label_desc: Use image node_id 3 for calling the ModuleWithRecordsAndReducer obj's underlying member method code with example usage: obj.set_reducer(reducer) without return types