code: def ref_average_pooling(
      x, kernel, stride, ignore_border, pad, channel_last, including_pad
  ):
      if channel_last:
          t = refs.ChannelLastToFirstTranspose(x.ndim, len(kernel))
          x = t(x)
          y = ref_average_pooling(
              x,
              kernel,
              stride,
              ignore_border,
              pad,
              False,
              including_pad,
          )
          y = t.inv(y)
          return y
      if len(kernel) == 3:
          y = ref_average_pooling_3d(
              x, kernel, stride, ignore_border, pad, including_pad
          )
          return y
      y = ref_average_pooling_2d(
          x, kernel, stride, ignore_border, pad, including_pad
      )
      return y
  
file_path: nnabla/python/test/function/test_average_pooling.py
imports: import pytest
  import numpy
  import nnabla.functions
  import refs
  from nbla_test_utils import list_context
label_desc: Use image node_id 3 for calling a global function with example usage: ref_average_pooling(x, kernel, stride, ignore_border, pad, channel_last, including_pad) and returns: y, y, y