code: def main():
      parser = _get_parser()
      opt = parser.parse_args()
  
      if opt.profile:
          with profile(
              activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],
              profile_memory=True,
              with_stack=True,
          ) as prof:
              with record_function("Translate"):
                  translate(opt)
          print(
              prof.key_averages().table(
                  sort_by="cuda_time_total", row_limit=40
              )
          )
      else:
          init_time = time()
          translate(opt)
          print(
              "Time w/o python interpreter load/terminate: ",
              time() - init_time,
          )
  
file_path: OpenNMT-py/onmt/bin/translate.py
imports: from onmt.inference_engine import InferenceEnginePY
  from onmt.opts import translate_opts
  from onmt.utils.parse import ArgumentParser
  from onmt.utils.misc import use_gpu, set_random_seed
  from torch.profiler import profile, record_function, ProfilerActivity
  from time import time
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types