code: def _reduce_loss(red, loss, axis, out):
      if red == "sum":
          return ivy.negative(ivy.sum(loss, axis=axis), out=out)
      elif red == "mean":
          return ivy.negative(ivy.mean(loss, axis=axis), out=out)
      else:
          return ivy.negative(loss, out=out)
  
file_path: ivy/ivy/functional/ivy/losses.py
imports: import ivy
  from typing import Optional, Union
  from ivy.func_wrapper import handle_array_function, handle_nestable, handle_array_like_without_promotion, inputs_to_ivy_arrays
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 1 for calling a global function with example usage: _reduce_loss(red, loss, axis, out) and returns: ivy, ivy, ivy