enable scalar reduction with dim=-1 (#88628)
Tested with all samples for `sum`, but also fixes all samples errors on other reductions (amin, amax, any, all etc)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88628
Approved by: https://github.com/desertfire