[codemod][type-comments] Convert type comments in api.py (#73084)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73084

I'm wrapping up the conversion of type comments to type annotations
in caffe2. The last remaining "bulk" codemod has test failures that
are hard for me to understand, so I'm going to submit PRs for each
module individually which makes it easier to see what's causing
problems.

All the codemods were produced via LibCST and then manually cleaned up.

Test Plan: Wait for github CI

Reviewed By: H-Huang

Differential Revision: D34344289

fbshipit-source-id: e8e3a13c3d95f6804829f1818fb7f0605e5ba137
(cherry picked from commit 92d47d9cd549e85d002dd22e5f377356a3a98348)
This commit is contained in:
Steven Troxler
2022-02-18 15:27:58 -08:00
committed by PyTorch MergeBot
parent 671c8a459a
commit 906d26fb9b

View File

@ -60,7 +60,7 @@ class MetricStream:
_metrics_map = {}
_default_metrics_handler = NullMetricHandler() # type: MetricHandler
_default_metrics_handler: MetricHandler = NullMetricHandler()
# pyre-fixme[9]: group has type `str`; used as `None`.