improve error messages when a method or attribute is missing (#27110)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/27110
Previously missing methods on some types like tensors would talk about
'builtins' which are only a thing inside of the compiler. Furthermore,
the error would only occur when the builtin was applied and it was discovered
that no builtin existed. This changes the error message so that it
discovers that method on our builtin types does not exist on attribute lookup.
Test Plan: Imported from OSS
Differential Revision: D17677616
Pulled By: zdevito
fbshipit-source-id: 2f7cf6c6093a9c832569c44f4b1044a2e56fe205