code: def __generate_model(self, input_data, output_layer):
      def without_batch(batch_shape):
          return batch_shape[1:]
  
      if isinstance(
          output_layer, keras.engine.Merge
      ):  # it's a list in case of Merge Layer
          assert isinstance(input_data, list)
          input_tensor = [
              Input(shape=without_batch(i.shape)) for i in input_data
          ]
      else:
          input_tensor = Input(shape=without_batch(input_data.shape))
      out_tensor = output_layer(input_tensor)
      return Model(input=input_tensor, output=out_tensor)
  
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 3 for calling the BigDLTestCase obj's underlying member method code with example usage: obj.__generate_model(input_data, output_layer) and returns: Model, batch_shape