improve error message on inferred type (#21058)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21058
ghimport-source-id: e7d6e082b0faf4f3d3e683f2c98863ee269439f0
Differential Revision: D15534670
Pulled By: suo
fbshipit-source-id: 8bbfd6e9c1afbc3006d7d55ed633e18618e05021