[torch][segment_reduce] Add support for sum and min reductions (#60379)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60379
This concludes the support for all reductions types initially planned (min, max, mean, sum).
Next Steps:
- Cleanups
- update default values when length is 0 and initial not given
- templatize the code to avoid branching with every item.( and other known improvements)
- more unit tests, verification
- benchmarking
Test Plan: updated unit tests.
Reviewed By: ngimel
Differential Revision: D29268218
fbshipit-source-id: c77d91671e01dcf96c18c758fa3ea522b2e13db9