docstr: Compare forward results for Keras layer against Zoo Keras API layer.
docstr_tok: ["Compare","forward","results","for","Keras","layer","against","Zoo","Keras","API","layer","."]
code: def compare_layer(
      self,
      klayer,
      zlayer,
      input_data,
      weight_converter=None,
      is_training=False,
      rtol=1e-6,
      atol=1e-6,
  ):
      """
      Compare forward results for Keras layer against Zoo Keras API layer.
      """
      from keras.models import Sequential as KSequential
      from bigdl.dllib.keras.models import Sequential as ZSequential
  
      zmodel = ZSequential()
      zmodel.add(zlayer)
      kmodel = KSequential()
      kmodel.add(klayer)
      koutput = kmodel.predict(input_data)
      from bigdl.dllib.keras.layers import BatchNormalization
  
      if isinstance(zlayer, BatchNormalization):
          k_running_mean = K.eval(klayer.running_mean)
          k_running_std = K.eval(klayer.running_std)
          zlayer.set_running_mean(k_running_mean)
          zlayer.set_running_std(k_running_std)
      if kmodel.get_weights():
          zmodel.set_weights(
              weight_converter(klayer, kmodel.get_weights())
          )
      zmodel.training(is_training)
      zoutput = zmodel.forward(input_data)
      self.assert_allclose(zoutput, koutput, rtol=rtol, atol=atol)
  
imports: from __future__ import print_function
  import logging
  import shutil
  from unittest import TestCase
  import keras.backend
  from bigdl.dllib.nncontext import *
  from bigdl.dllib.feature.image import ImageSet
label_desc: Use image node_id 7 for calling the ZooTestCase obj's underlying member method code with example usage: obj.compare_layer(klayer, zlayer, input_data, weight_converter, is_training, rtol, atol) without return types