Cache node operators to speed up optimization (#24827)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/24827
We already cache the node's schema, but alias analysis wants operators.
This ends up being almost 70% of the on-cpu time optimizing a large
graph.
Here's some results on a [sample model](https://gist.github.com/suo/63ab9638516002176f94553a37060f61)
(the units are seconds).
Before:
```
compiled in: 20.256319999694824
first run in: 313.77824568748474
```
After:
```
compiled in: 18.8815860748291
first run in: 42.58739233016968
```
More than a 7x speedup! Still slower than I'd like though so I'll keep
digging.
Test Plan: Imported from OSS
Differential Revision: D16887540
Pulled By: suo
fbshipit-source-id: 2449be2898889d00ac094c3896e37b0e6a8c5f08