Better error when using a constant tensor (#16724)
Summary:
Fixes #16284
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16724
Differential Revision: D13990531
Pulled By: driazati
fbshipit-source-id: adbf47a07eddb3813fbe1322944abfe5fcff89fa