Skip to content

[Fall 2021] Step 1: Pyre - Fix type checking errors in Pytorch torch/quantization/fx/fusion_patterns.py #71

@0xedward

Description

@0xedward

This task is part of a bigger effort to migrate Pytorch from Mypy to Pyre. The goal of this task for you is to gain comfort with the Python type system and the types of errors Pyre gives. Future Pysa project work and debugging builds on this foundation.

Development Environment Setup

Task Description

Fix the Pyre type checking errors in torch/quantization/fx/fusion_patterns.py:

torch/quantization/fx/fusion_patterns.py:25:13 Incompatible variable type [9]: fuse_custom_config_dict is declared to have type `Dict[str, typing.Any]` but is used as type `None`.
torch/quantization/fx/fusion_patterns.py:64:13 Incompatible variable type [9]: fuse_custom_config_dict is declared to have type `Dict[str, typing.Any]` but is used as type `None`.
torch/quantization/fx/fusion_patterns.py:121:13 Incompatible variable type [9]: fuse_custom_config_dict is declared to have type `Dict[str, typing.Any]` but is used as type `None`.

Submitting a PR

We use the following linters internally, so to save everyone's time, please make sure you run the following linters locally and fix errors related to the files you modified before submitting a PR:

black && usort format . && flake8

To install the linters, you can run the following command:

pip install flake8 usort black==21.4b2

Metadata

Metadata

Assignees

Labels

Fall 2021Issues related to the Pysa project for MLH Fellowship cohort of Fall 2021pyrestep 1Level 1 project for MLH Fall 2021

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions