pytorch
affd598c - Fix/simplify alias annotation handling in op codegen. (#32574)

Commit
4 years ago
Fix/simplify alias annotation handling in op codegen. (#32574) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/32574 Previously, we ignored alias annotations when deriving argument mutability and instead recognized particular signature patterns (in-place, out variant) and assigned mutability accordingly. Op signatures that didn't fit these patterns would error (e.g. see #30526, which this fixes). No change in the generated binding code. Code changes: 1. in function_wrapper.py, fix the mutability derivation logic used when creating an argument's c++ type property. Note that we temporarily need to trap a special case and apply the old logic, see code comment for details. 2. in gen_jit_dispatch.py, update logic that assumed only one mutable Tensor argument per declaration. Happily this mostly was accomplished by bypassing some now-redundant signature regeneration machinery. Another special case here requires that we keep the old machinery around temporarily. Test Plan: Imported from OSS Differential Revision: D19564875 Pulled By: bhosmer fbshipit-source-id: 5637a9672923676d408c9586f3420bcc0028471a
Author
Basil Hosmer
Parents
Loading