Skip to content

Use inference_mode instead of no_grad for pth v1.9.0 #2193

@vfdev-5

Description

@vfdev-5

🚀 Feature

The idea is to replace where it is appropriate torch.no_grad with inference_mode to speed-up computations: evalutation, metrics.

This works since pytorch v1.9.0.

Let's also benchmark the speed-up on a simple case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions