Shortcuts

torch.autograd.profiler.profile.key_averages

profile.key_averages(group_by_input_shape=False, group_by_stack_n=0)[source][source]

Averages all function events over their keys.

Parameters
  • group_by_input_shapes – group entries by (event name, input shapes) rather than just event name. This is useful to see which input shapes contribute to the runtime the most and may help with size-specific optimizations or choosing the best candidates for quantization (aka fitting a roof line)

  • group_by_stack_n – group by top n stack trace entries

Returns

An EventList containing FunctionEventAvg objects.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources