[BE] Use ValueError for input.dim check in torch.nn.modules (#105127)
Summary: Use ValueError for input.dim check instead of Assertion Error.
Fix: #104839
Test Plan: Please see GitHub actions.
Differential Revision: D47427998
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105127
Approved by: https://github.com/albanD, https://github.com/Skylion007