class_docstr: Keras test
class_docstr_tok: ["Keras","test"]
docstr: test_forward_pool
docstr_tok: ["test_forward_pool"]
code: def test_forward_pool(self, keras_mod):
      """test_forward_pool"""
      data = keras_mod.layers.Input(shape=(32, 32, 1))
      # maxpool
      x = keras_mod.layers.MaxPooling2D(
          (3, 3), strides=(1, 1), padding="same"
      )(data)
      keras_model = keras_mod.models.Model(data, x)
      verify_keras_frontend(keras_model)
      # avgpool
      y = keras_mod.layers.AveragePooling2D(
          (3, 3), strides=(1, 1), padding="same"
      )(data)
      keras_model = keras_mod.models.Model(data, y)
      verify_keras_frontend(keras_model)
      # reject the invalid input shape
      data = keras_mod.layers.Input(shape=(0, 3, 6, 4))
      x = keras_mod.layers.GlobalAveragePooling3D()(data)
      keras_model = keras_mod.models.Model(data, x)
      with pytest.raises(ValueError):
          verify_keras_frontend(keras_model)
  
imports: from packaging import version
  import numpy
  from tensorflow import keras
  import keras
  import pytest
  import tvm
  from tvm import relay
  from tvm.contrib import graph_executor
  import tvm.testing
label_desc: Use image node_id 9 for calling the TestKeras obj's underlying member method code with example usage: obj.test_forward_pool(keras_mod) without return types