Table of Contents
Shortcuts

# torch.autograd.profiler.profile.key_averages

profile.key_averages(group_by_input_shape=False, group_by_stack_n=0)

  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

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.