class_docstr: Keras test
class_docstr_tok: ["Keras","test"]
docstr: test_forward_reuse_layers
docstr_tok: ["test_forward_reuse_layers"]
code: def test_forward_reuse_layers(self, keras_mod):
      """test_forward_reuse_layers"""
      # reuse conv2d
      data = keras_mod.layers.Input(shape=(32, 32, 3))
      conv2d = keras_mod.layers.Conv2D(8, (3, 3), padding="same")
      x = conv2d(data)
      y = conv2d(data)
      add_z = keras_mod.layers.Add()([x, y])
      out = keras_mod.layers.GlobalAveragePooling2D()(add_z)
      keras_model = keras_mod.models.Model(data, out)
      verify_keras_frontend(keras_model)
      # reuse add
      data = keras_mod.layers.Input(shape=(32, 32, 3))
      x = keras_mod.layers.Conv2D(8, (3, 3), padding="same")(data)
      add = keras_mod.layers.Add()
      x = add([x, x])
      x = add([x, x])
      out = keras_mod.layers.GlobalAveragePooling2D()(x)
      keras_model = keras_mod.models.Model(data, out)
      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 19 for calling the TestKeras obj's underlying member method code with example usage: obj.test_forward_reuse_layers(keras_mod) without return types