add input check at the beginning for C++ API `interpolate` (#108506)
Fixes https://github.com/pytorch/pytorch/issues/108346
add the input check to the beginning for C++ API `interpolate`, raise an error when got an invalid input.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/108506
Approved by: https://github.com/ezyang