code: def compare_unary_op(
      self, kk_func, z_layer, shape, rtol=1e-5, atol=1e-5
  ):
      x = klayers.Input(shape=shape[1:])
  
      batch = shape[0]
  
      kkresult = kk_func(x)
      x_value = np.random.uniform(0, 1, shape)
  
      k_grads = KK.get_session().run(
          KK.gradients(kkresult, x), feed_dict={x: x_value}
      )
      k_output = KK.get_session().run(kkresult, feed_dict={x: x_value})
      model = Sequential()
      model.add(InputLayer(shape[1:]))
      model.add(z_layer)
      z_output = model.forward(x_value)
      grad_output = np.array(z_output)
      grad_output.fill(1.0)
      z_grad = model.backward(x_value, grad_output)
  
      z_output2 = model.forward(x_value)
      z_grad2 = model.backward(x_value, grad_output)
      self.assert_allclose(z_output, z_output2, rtol, atol)
      self.assert_allclose(z_grad, z_grad2, rtol, atol)
  
      self.assert_allclose(z_output, k_output, rtol, atol)
      self.assert_allclose(z_grad, k_grads[0], rtol, atol)
  
imports: import keras.backend
  import keras.layers
  import numpy
  import pytest
  from test.zoo.pipeline.utils.test_utils import ZooTestCase
  from zoo.pipeline.api.autograd import *
  import zoo.pipeline.api.autograd
  from zoo.pipeline.api.keras.layers import *
  from zoo.pipeline.api.keras.models import Sequential, Model
  from zoo.pipeline.api.utils import remove_batch
label_desc: Use image node_id 2 for calling the TestOperator obj's underlying member method code with example usage: obj.compare_unary_op(kk_func, z_layer, shape, rtol, atol) without return types