Add thrift and tensorpipe backend tests for test_ddp_under_dist_autograd. (#40210)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40210
ghstack-source-id: 106300839
Test Plan: waitforbuildbot
Differential Revision: D22110065
fbshipit-source-id: d9ebd009b8d451c75708eadc7eb3f2b788e875aa