code: def torch_profiler_full(func):
      """
      A decorator which will run the torch profiler for the decorated function,
      printing the results in full.
      Note: Enforces a gpu sync point which could slow down pipelines.
      """
  
      @wraps(func)
      def wrapper(*args, **kwargs):
          with torch.autograd.profiler.profile(use_cuda=True) as prof:
              result = func(*args, **kwargs)
  
          print(prof, flush=True)
  
          return result
  
      return wrapper
  
imports: from __future__ import annotations
  import csv
  import datetime
  import multiprocessing
  import os
  import sys
  import threading
  from collections import defaultdict, namedtuple
  from contextlib import contextmanager
  from functools import wraps
  from inspect import getframeinfo, stack
  from queue import Empty
  from time import perf_counter, perf_counter_ns
  from typing import TYPE_CHECKING, Any, cast
  import numpy
  import torch
  from monai.utils import optional_import
label_desc: Use image node_id 1 for calling a global function with example usage: torch_profiler_full(func) and returns: wrapper, result