Add `input` argument to `autograd.backward()` cpp api (#47214)
Summary:
Helps fix https://github.com/pytorch/pytorch/issues/46373 for the cpp api.
Follow up to https://github.com/pytorch/pytorch/pull/46855/ which only changed the api for python only
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47214
Reviewed By: agolynski
Differential Revision: D24716139
Pulled By: soulitzer
fbshipit-source-id: 3e1f35968e8dee132985b883481cfd0d1872ccdd