[inductor] Enable mypy checking in torch/_inductor/metrics.py (#105793)
As suggested in https://github.com/pytorch/pytorch/issues/105230
Implements small fix for torch/_inductor/metrics.py
I ran into a circular import, which I handled using if TYPE_CHECKING (https://docs.python.org/3/library/typing.html#constant).
There are then two options for describing the types, either use their class names as strings or use from future import annotations
```
If from __future__ import annotations is used, annotations are not evaluated at function definition time.
Instead, they are stored as strings in __annotations__.
This makes it unnecessary to use quotes around the annotation (see [PEP 563](https://peps.python.org/pep-0563/)).
```
I'm open to suggestions if it does not meet your coding guidelines
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105793
Approved by: https://github.com/Skylion007