nip.timing.timeables.time_timeable

Contents

nip.timing.timeables.time_timeable#

nip.timing.timeables.time_timeable(name: str, log_tensorboard_results: bool = True, print_results: bool = False, record_shapes: bool = True, profile_memory: bool = True, with_stack: bool = False, *, param_scale: float = 1.0, **kwargs) profile[source]#

Time a timeable by its name.

Parameters:
  • name (str) – The name of the timeable to time.

  • log_tensorboard_results (bool, default=True) – Whether to log the results to TensorBoard in the log directory.

  • record_shapes (bool, default=True) – Whether to record tensor shapes. This introduces an additional overhead.

  • profile_memory (bool, default=True) – Whether to profile memory usage.

  • with_stack (bool, default=False) – Whether to record the stack trace. This introduces an additional overhead.

  • print_results (bool, default=False) – Whether to print the results of the timing.

  • param_scale (float, default=1.0) – The scale factor for key default parameters.

  • **kwargs – Any additional keyword arguments that are passed to the timeable constructor.

Returns:

profiler (torch.profiler.profile) – The PyTorch profiler containing the timing information.