Commit Graph

8 Commits

Author SHA1 Message Date
yuguo68
519347df49 fix gather sparse_grad backward crash with empty index tensor
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78698

Approved by: https://github.com/ngimel
2022-06-04 02:25:05 +00:00
Mikayla Gawarecki
2a9779adbf Bugfix NAN and Inf handling for scatter_reduce (amin and amax)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75651

Approved by: https://github.com/cpuhrsch
2022-05-06 15:39:57 +00:00
PyTorch MergeBot
4aa6b6b9de Revert "Bugfix NAN and Inf handling for scatter_reduce (amin and amax)"
This reverts commit 4441582f80.

Reverted https://github.com/pytorch/pytorch/pull/75651 on behalf of https://github.com/malfet
2022-05-04 21:29:07 +00:00
Mikayla Gawarecki
4441582f80 Bugfix NAN and Inf handling for scatter_reduce (amin and amax)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75651

Approved by: https://github.com/cpuhrsch
2022-05-03 20:10:30 +00:00
Mikayla Gawarecki
e9a8e6f74a Add include_self flag to scatter_reduce
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74607

Approved by: https://github.com/cpuhrsch
2022-04-05 16:31:39 +00:00
Mikayla Gawarecki
f7829812b4 scatter_reduce CUDA support
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74606

Approved by: https://github.com/cpuhrsch
2022-04-01 15:28:06 +00:00
Mikayla Gawarecki
2bfa018462 [BC-breaking] Use ScatterGatherKernel for scatter_reduce (CPU-only) (#74226)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74226

Update signature of `scatter_reduce_` to match `scatter_/scatter_add_`

`Tensor.scatter_reduce_(int64 dim, Tensor index, Tensor src, str reduce)`

- Add new reduction options in ScatterGatherKernel.cpp and update `scatter_reduce` to call into the cpu kernel for `scatter.reduce`
- `scatter_reduce` now has the same shape constraints as `scatter_` and `scatter_add_`
- Migrate `test/test_torch.py:test_scatter_reduce` to `test/test_scatter_gather_ops.py`

Test Plan: Imported from OSS

Reviewed By: ngimel

Differential Revision: D35222842

Pulled By: mikaylagawarecki

fbshipit-source-id: 84930add2ad30baf872c495251373313cb7428bd
(cherry picked from commit 1b45139482e22eb0dc8b6aec2a7b25a4b58e31df)
2022-04-01 05:57:45 +00:00
Mike Ruberry
e0d829a266 Kill the test_torch.py mixin and creates test_scatter_gather_ops (#71691)
Summary:
Per title.

Also annotates test_torch.py with additional cleanup tasks and adds empty sample inputs to elementwise unary and binary OpInfos.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71691

Reviewed By: ngimel

Differential Revision: D33735126

Pulled By: mruberry

fbshipit-source-id: 8cc097a7581a8b620540c95b2a5889c1165ecf23
(cherry picked from commit 5c6a245a3f)
2022-01-24 09:32:32 +00:00