simplify aliasdb interface (#17453)
Summary:
Stack:
:black_circle: **#17453 [jit] simplify aliasdb interface** [:yellow_heart:](https://our.intern.facebook.com/intern/diff/D14205209/)
The previous "getWrites" API relies on the user to do alias checking, which is confusing and inconsistent with the rest of the interface. So replace it with a higher-level call.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17453
Differential Revision: D14209942
Pulled By: suo
fbshipit-source-id: d4aff2af6062ab8465ee006fc6dc603296bcb7ab