pytorch/tools/code_coverage/oss_coverage.py
Nikita Shulga 634659e262 Update mypy to 1.4.1 (#91983)
Mostly fixes for PEP-484 violation (i.e. when default arg is set to None, but type is not annotated as optional)
Plus few real fixes:
  - Add missing `_get_upgraders_entry_map` to `torch/_C/__init__.pyi`
  - Add missing return statement to `torch._export. deserialize_graph`
  - Fix error message in `torch.ao.ns.fx.weight_utils.get_lstm_mod_weights`
  -
TODO (in followup PR):
  - Fix erroneous `isinstance` check in `torch/ao/quantization/_pt2e/qat_utils.py`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/91983
Approved by: https://github.com/kit1980, https://github.com/ZainRizvi, https://github.com/huydhn, https://github.com/thiagocrepaldi, https://github.com/aaronenyeshi
2023-07-13 16:30:36 +00:00

25 lines
870 B
Python

#!/usr/bin/env python3
import time
from package.oss.cov_json import get_json_report # type: ignore[import]
from package.oss.init import initialization # type: ignore[import]
from package.tool.summarize_jsons import summarize_jsons # type: ignore[import]
from package.util.setting import TestPlatform # type: ignore[import]
from package.util.utils import print_time # type: ignore[import]
def report_coverage() -> None:
start_time = time.time()
(options, test_list, interested_folders) = initialization()
# run cpp tests
get_json_report(test_list, options)
# collect coverage data from json profiles
if options.need_summary:
summarize_jsons(test_list, interested_folders, [""], TestPlatform.OSS)
# print program running time
print_time("Program Total Time: ", start_time)
if __name__ == "__main__":
report_coverage()