code: def test_average_pool_invalid(
      device, x_shape, ksize, stride, pad, pad_mode, float_dtype
  ):
      x = numpy.random.uniform(-1, 1, x_shape).astype(float_dtype)
      x = chainerx.array(x)
      pad_mode_kwargs = _get_pad_mode_kwargs(pad_mode, True)
      with pytest.raises(chainerx.DimensionError):
          chainerx.average_pool(
              x, ksize=ksize, stride=stride, pad=pad, **pad_mode_kwargs
          )
  
imports: import functools
  from operator import mul
  import unittest
  import chainer
  import numpy
  import pytest
  import chainerx
  from chainerx_tests import op_utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_average_pool_invalid(device, x_shape, ksize, stride, pad, pad_mode, float_dtype) without return types