code: def testEagerFunctionExecution(self):
      instrument = _NumpyFunctionCallback()
  
      @def_function.function
      def square_log(x):
          return math_ops.square(math_ops.log(x))
  
      # Call the function once, so that the graph construction won't show up
      # in the callback.
      x_float32 = constant_op.constant(6.0, dtype=dtypes.float32)
      x_float64 = constant_op.constant(6.0, dtype=dtypes.float64)
      square_log(x_float32)
      square_log(x_float64)
  
      op_callbacks.add_op_callback(instrument.callback)
      y = square_log(x_float32)
      self.assertAllClose(y, np.square(np.log(6.0)))
      y = square_log(x_float64)
      self.assertAllClose(y, np.square(np.log(6.0)))
  
      self.assertEqual(instrument.eager_op_names, [None, None])
      self.assertFalse(instrument.graph_op_types)
      self.assertFalse(instrument.graph_op_names)
      self.assertFalse(instrument.graph_inputs)
  
      # Each of the two dtypes should be associated with its own FuncGraph.
      self.assertIn(
          square_log.get_concrete_function(x_float32).name,
          instrument.eager_op_types,
      )
      self.assertIn(
          square_log.get_concrete_function(x_float64).name,
          instrument.eager_op_types,
      )
  
      self.assertEqual(len(instrument.eager_inputs), 2)
      self.assertIsInstance(instrument.eager_inputs[0], tuple)
      self.assertEqual(instrument.eager_inputs[0][0], x_float32)
      self.assertIsInstance(instrument.eager_inputs[1], tuple)
      self.assertEqual(instrument.eager_inputs[1][0], x_float64)
  
imports: import threading
  import numpy
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import op_callbacks
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import script_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.util import compat
label_desc: Use image node_id 6 for calling the OpCallbacksTest obj's underlying member method code with example usage: obj.testEagerFunctionExecution() and returns: math_ops