pytorch
34213958 - [quant][fx] Add support for matching multiple arguments in patterns (#89986)

Commit
2 years ago
[quant][fx] Add support for matching multiple arguments in patterns (#89986) Summary: This PR adds support for matching patterns that has multiple arguments, it's needed for quantization in PyTorch 2.0 early prototype Before this PR, we only support patterns like: ``` x -> conv -> bn -> relu (relu, (bn, conv)) ``` where each operator has a single node, the code breaks when we want to match a pattern that has an op that has multiple arguments, such as: ``` shape \ transpose -> reshape -> output -> ``` where `reshape` has two arguments Test Plan: python test/test_quantization.py TestQuantizeFx.test_match_pattern_with_multiple_args Reviewers: Subscribers: Tasks: Tags: Pull Request resolved: https://github.com/pytorch/pytorch/pull/89986 Approved by: https://github.com/vkuzo
Author
Committer
Parents
Loading