class_docstr: Abstract class for the loss function.
class_docstr_tok: ["Abstract","class","for","the","loss","function","."]
docstr: Aggregates the loss of each sample either by adding or taking the mean w.r.t. the number of corruptions.
docstr_tok: ["Aggregates","the","loss","of","each","sample","either","by","adding","or","taking","the","mean","w.r.t",".","the","number","of","corruptions","."]
code: def _reduce_sample_loss(self, loss):
      """Aggregates the loss of each sample either by adding or taking the mean w.r.t. the number of corruptions."""
      if self._loss_parameters["reduction"] == "sum":
          return tf.reduce_sum(loss, 0)
      else:
          return tf.reduce_mean(loss, 0)
  
imports: import abc
  import logging
  import six
  import tensorflow
  from tensorflow.python.keras import metrics
  from tensorflow.python.keras.utils import losses_utils
  from tensorflow.python.ops import math_ops
label_desc: Use image node_id 3 for calling the Loss obj's underlying member method code with example usage: obj._reduce_sample_loss(loss) and returns: tf, tf