code: def _test_batch_mode(layer, **kwargs):
      X = np.random.normal(size=(batch_size, N, F))
      if "target_shape" in kwargs:
          target_output_shape = kwargs.pop("target_shape")
      else:
          target_output_shape = (batch_size, kwargs.get("channels", F))
  
      X_in = Input(shape=(N, F))
      layer_instance = layer(**kwargs)
      output = layer_instance(X_in)
      model = Model(X_in, output)
      output = model(X)
      assert output.shape == target_output_shape
      assert output.shape == layer_instance.compute_output_shape(
          X.shape
      )
      _check_output_and_model_output_shapes(
          output.shape, model.output_shape
      )
  
file_path: spektral/tests/test_layers/pooling/test_global_pooling.py
imports: import numpy
  import tensorflow
  from tensorflow.keras import Input, Model
  from spektral.layers import GlobalAttentionPool, GlobalAttnSumPool, GlobalAvgPool, GlobalMaxPool, GlobalSumPool, SortPool
  from tests.test_layers.convolutional.core import _test_get_config
label_desc: Use image node_id 3 for calling a global function with example usage: _test_batch_mode(layer) without return types