Add python API for get_gradients() method. (#28926)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/28926
The get_gradients method was a pybind only method without any
documentation for this method for users.
I've moved this method to our python distributed autograd API and ensured that
we have appropriate docs for this method.
ghstack-source-id: 93558845
Test Plan: waitforbuildbot
Differential Revision: D18234443
fbshipit-source-id: 317267d8c2416da75afd3f9d900a3cd74bb78dfb