add TypeError to c10 and fix segfault in error checking in Tensor constructor (#40106)
Summary:
As per title.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40106
Differential Revision: D22137193
Pulled By: albanD
fbshipit-source-id: 11d059263c00a834211f016bd9a9e18fdc0437ef