code: def _benchmark_eager_apply(
      self, label, device_and_format, defun=False, execution_mode=None
  ):
      with context.execution_mode(execution_mode):
          device, data_format = device_and_format
          model = resnet50.ResNet50(data_format)
          if defun:
              model.call = tf.function(model.call)
          batch_size = 64
          num_burn = 5
          num_iters = 30
          with tf.device(device):
              images, _ = resnet50_test_util.random_batch(
                  batch_size, data_format
              )
              for _ in range(num_burn):
                  model(images, training=False).cpu()
              if execution_mode:
                  context.async_wait()
              gc.collect()
              start = time.time()
              for _ in range(num_iters):
                  model(images, training=False).cpu()
              if execution_mode:
                  context.async_wait()
              self._report(
                  label,
                  start,
                  num_iters,
                  device,
                  batch_size,
                  data_format,
              )
  
imports: import gc
  import os
  import tempfile
  import time
  import tensorflow
  from tensorflow.python.client import device_lib
  from tensorflow.python.eager import context
  from tensorflow.python.eager import record
  from tensorflow.python.eager.benchmarks.resnet50 import resnet50
  from tensorflow.python.eager.benchmarks.resnet50 import resnet50_test_util
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 4 for calling the ResNet50Benchmarks obj's underlying member method code with example usage: obj._benchmark_eager_apply(label, device_and_format, defun, execution_mode) without return types