code: def test_rn50_benchmark(
      pipe_fun=rn50_pipeline,
      batch_size=8,
      num_threads=2,
      num_samples=256,
      data_path=None,
      save_df=None,
  ):
      if not data_path:
          data_path = os.path.join(
              get_dali_extra_path(), "db/single/jpeg"
          )
  
      print(f"num_threads: {num_threads}, batch_size: {batch_size}")
  
      full_stand, build_stand, times_stand = run_benchmark(
          pipe_fun,
          batch_size,
          num_threads,
          num_samples,
          False,
          data_path,
      )
      iter_time_stand = np.mean(times_stand[1:]) / batch_size
      avg_speed_stand = num_samples / full_stand
  
      print(
          f"Stand pipeline --- time: {full_stand:8.5f} [s] --- "
          f"build + 1st iter time: {build_stand:.5f} [s] --- "
          f"avg iter time per sample: {iter_time_stand:7.5f} [s] --- "
          f"avg speed: {avg_speed_stand:8.3f} [img/s]"
      )
  
      full_debug, build_debug, times_debug = run_benchmark(
          pipe_fun,
          batch_size,
          num_threads,
          num_samples,
          True,
          data_path,
      )
      iter_time_debug = np.mean(times_debug[1:]) / batch_size
      avg_speed_debug = num_samples / full_debug
  
      print(
          f"Debug pipeline --- time: {full_debug:8.5f} [s] --- "
          f"build + 1st iter time: {build_debug:.5f} [s] --- "
          f"avg iter time per sample: {iter_time_debug:7.5f} [s] --- "
          f"avg speed: {avg_speed_debug:8.3f} [img/s]"
      )
  
      if save_df is not None:
          df = pd.DataFrame(
              {
                  "type": ["standard_sync", "debug_old"],
                  "batch_size": batch_size,
                  "time": [full_stand, full_debug],
                  "iter_time": [iter_time_stand, iter_time_debug],
                  "avg_speed": [avg_speed_stand, avg_speed_debug],
              }
          )
          return pd.concat([save_df, df])
  
      return None
  
file_path: DALI/dali/test/python/test_pipeline_debug_resnet50.py
imports: import argparse
  import numpy
  import nvidia.dali.fn
  import nvidia.dali.types
  import os
  from itertools import product
  from nvidia.dali.pipeline.experimental import pipeline_def
  from time import time
  from test_utils import get_dali_extra_path
label_desc: Use image node_id 4 for calling a global function with example usage: test_rn50_benchmark(pipe_fun, batch_size, num_threads, num_samples, data_path, save_df) and returns: None, pd