code: def schedule(
      func: Optional[object] = None,
      wait: int = 2,
      warmup: int = 2,
      active: int = 2,
      repeat: int = 1,
      skip_first: int = 0,
  ):
      """Wrapper to create a ```torch.profiler.schedule``` (sets default parameters for warm-up)."""
      torch_scheduler = profiler.schedule(
          wait=wait,
          warmup=warmup,
          active=active,
          repeat=repeat,
          skip_first=skip_first,
      )
      """
      Curious which action a default scheduler suggests at which profiler.step() ?
          [torch_scheduler(x) for x in range(10)]
  
          00 = {ProfilerAction} ProfilerAction.NONE
          01 = {ProfilerAction} ProfilerAction.NONE
          02 = {ProfilerAction} ProfilerAction.WARMUP
          03 = {ProfilerAction} ProfilerAction.WARMUP
          04 = {ProfilerAction} ProfilerAction.RECORD
          05 = {ProfilerAction} ProfilerAction.RECORD_AND_SAVE
          06 = {ProfilerAction} ProfilerAction.NONE
          07 = {ProfilerAction} ProfilerAction.NONE
          08 = {ProfilerAction} ProfilerAction.NONE
          09 = {ProfilerAction} ProfilerAction.NONE
      """
  
      return set_profiler_attr(
          func=func, set_attr="schedule", handler=torch_scheduler
      )
  
file_path: speechbrain/speechbrain/utils/profiling.py
imports: import numpy
  from copy import deepcopy
  from torch import profiler
  from functools import wraps
  from typing import Any, Callable, Iterable, Optional
label_desc: Use image node_id 2 for calling a global function with example usage: schedule(func, wait, warmup, active, repeat, skip_first) and returns: set_profiler_attr