Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ns for fx: remove restriction on nodes with no args and only kwargs
Summary: Removes the restriction from NS for FX on handling nodes which have no positional arguments, such as `F.linear(input=x, weight=w, bias=b). In order to achieve this, we delete all places in the code which were doing things like ``` node.args[0] ``` And replace them with ``` _get_normalized_nth_input(node, gm, 0) ``` The `_get_normalized_nth_input` function is a best effort way to get the n'th normalized input. This is needed because some FX tools output nodes normalized to be kwargs only, and we need to be able to handle this in NS. Test plan: ``` python test/test_quantization.py -k test_linear_kwargs_shadow ``` Pull Request resolved: pytorch#78181 Approved by: https://github.com/z-a-f, https://github.com/hx89
- Loading branch information