code: def _global_average_pool(x: np.ndarray) -> np.ndarray:
      axis = tuple(range(2, np.ndim(x)))
      y = np.average(x, axis=axis)
      for _ in axis:
          y = np.expand_dims(y, -1)
      return y
  
imports: import numpy
  from onnx.reference.op_run import OpRun
label_desc: Use image node_id 1 for calling a global function with example usage: _global_average_pool(x) and returns: y