Simplify TensorImpl size check and fix error message (#72070)
Summary:
Today, the enum is ignored and the generic assert within the equal function is used leading to no information in the error message when this fails.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72070
Reviewed By: bdhirsh
Differential Revision: D33893602
Pulled By: albanD
fbshipit-source-id: 4bc644e9232cbf0bafef22d713948915eb6964ff
(cherry picked from commit bdcc5f5f476f3b9ccd2068f365a734b7df756f02)