port Bazel //tools/autograd to shared build structure
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74749
Differential Revision: [D35145072](https://our.internmc.facebook.com/intern/diff/D35145072/)
**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D35145072/)!
Approved by: https://github.com/albanD
Author
Michael Andreas Dagitses