viable/strict/1789065007: [BE] Unify reflection/replication padding shape checks (#196457)
- PyTorch: 753 events in the last 90 days
- PyTorch: 743th Release in the last 90 days
- Previous: earlier the same day · viable/strict/1789046736: [Test] Refactor `test_indexing.py` (#194731)
What happened
Similar to the pooling input validation unification ( #196230 ), the six pad ops hand-wrote the same shape checks in a dozen places across CPU, CUDA and MPS, and the copies had drifted. Collect them in Padding.h next to the existing check_valid_input, parameterized by rank and by whether the caller is reflection padding, and route every backend through them. All three now report identical errors, matching the alread…
Summary assembled by rule from the sources below