code: def AvgPool(a, k, strides, padding, data_format):
      
      if data_format.decode("ascii") == "NCHW":
          a = np.rollaxis(a, 1, -1),
  
      patches = _pool_patches(a, k, strides, padding.decode("ascii"))
      pool = np.average(patches, axis=tuple(range(-len(k), 0)))
  
      if data_format.decode("ascii") == "NCHW":
          pool = np.rollaxis(pool, -1, 1)
  
      return pool,
docs: Average pooling op.