[metal] Fix binary elementwise ops to handle inputs with mismatched dim() (#58262)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/58262
When broadcasting, it can be fine for input tensors to have a different number of dims. Fix the checks in arithmetic ops to accept these cases.
Test Plan:
Test on device:
```
arc focus2 pp-ios
```
Test on mac
```
buck test pp-macos
```
Reviewed By: xta0
Differential Revision: D27093367
fbshipit-source-id: 797eeffa1864291cb0e40277372842dca145c9c0