Allow Tensor-likes in torch.autograd.gradcheck (#45732)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/42942
Re-do of https://github.com/pytorch/pytorch/issues/43877.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45732
Reviewed By: mruberry
Differential Revision: D24195820
Pulled By: albanD
fbshipit-source-id: 8f43353077f341e34371affd76be553c0ef7d98a