code: def get_reduce_axes(per_image, **kwargs):
      backend = kwargs["backend"]
      axes = (
          [1, 2]
          if backend.image_data_format() == "channels_last"
          else [2, 3]
      )
      if not per_image:
          axes.insert(0, 0)
      return axes
  
file_path: segmentation_models/segmentation_models/base/functional.py
label_desc: Use image node_id 2 for calling a global function with example usage: get_reduce_axes(per_image) and returns: axes