code: def modelTest(
      self,
      input_data,
      keras_model,
      random_weights=True,
      dump_weights=False,
      is_training=False,
      rtol=1e-6,
      atol=1e-6,
  ):
      if random_weights:
          # Randomly generate weights instead of using initial weights
          kweights = keras_model.get_weights()
          new_kweights = self.__generate_random_weights(kweights)
          keras_model.set_weights(new_kweights)
      # weight_converter is a function keras [ndarray]-> bigdl [ndarray]
      keras_model_json_path, keras_model_hdf5_path = dump_keras(
          keras_model, dump_weights=dump_weights
      )
  
      # Use Theano backend to load as a bigdl model
      self.__set_keras_backend("theano")
      bigdl_model = DefinitionLoader.from_json_path(
          keras_model_json_path
      )
      bigdl_model.training(is_training)
      bigdl_output = bigdl_model.forward(input_data)
  
      # Use TensorFlow backend to compare results
      self.__set_keras_backend("tensorflow")
      keras_output = keras_model.predict(input_data)
      # TODO: we should verify bigdl_output and keras_output here
      #  init result is not the same, so we disable the verification  for now
      # self.assert_allclose(bigdl_output,
      #                      keras_output,
      #                      rtol=rtol,
      #                      atol=atol)
      if dump_weights:  # load weights if possible
          WeightLoader.load_weights_from_hdf5(
              bigdl_model, keras_model, keras_model_hdf5_path
          )
  
      bigdl_output2 = bigdl_model.forward(input_data)
      self.assert_allclose(
          bigdl_output2, keras_output, rtol=rtol, atol=atol
      )
  
imports: from __future__ import print_function
  import numpy
  from keras.models import Sequential, Model
  from keras.layers.core import *
  from keras.layers.convolutional import *
  from keras.layers import Dense, Dropout, Input
  from keras.optimizers import RMSprop
  from bigdl.dllib.utils.common import *
  from bigdl.dllib.keras.converter import *
  from bigdl.dllib.keras.converter import WeightLoader, WeightsConverter
  import numpy
  from unittest import TestCase
  import keras
  from bigdl.dllib.nn.keras.keras_utils import *
label_desc: Use image node_id 9 for calling the BigDLTestCase obj's underlying member method code with example usage: obj.modelTest(input_data, keras_model, random_weights, dump_weights, is_training, rtol, atol) without return types