code: def test_forward(
      input_shape, input_dim, dtype, indices_dtype, combiner
  ):
      indices = np.random.randint(
          low=0, high=input_dim, size=input_shape
      ).astype(indices_dtype)
      params = np.random.random(size=(input_dim, 16)).astype(dtype)
      if combiner == "sum":
          weights = np.random.random(size=indices.shape).astype(dtype)
      else:
          weights = None
      expected = manual_embedding_bag(
          indices, params, weights, combiner=combiner
      )
      embedding_bag = EmbeddingBag(
          input_dim, 16, combiner=combiner, dtype=dtype
      )
      embedding_bag.build(indices.shape)
      embedding_bag.set_weights([params])
      indices = tf.convert_to_tensor(indices)
      if weights is not None:
          weights = tf.convert_to_tensor(weights)
      output = embedding_bag(
          indices,
          weights,
      )
      test_utils.assert_allclose_according_to_type(
          expected, output, half_rtol=1e-2, half_atol=1e-2
      )
  
file_path: addons/tensorflow_addons/layers/tests/embedding_bag_test.py
imports: import pytest
  import numpy
  import tensorflow
  from tensorflow_addons.layers.embedding_bag import EmbeddingBag, _embedding_bag
  from tensorflow_addons.utils import test_utils
label_desc: Use image node_id 2 for calling a global function with example usage: test_forward(input_shape, input_dim, dtype, indices_dtype, combiner) without return types