Files
tinygrad/extra
Josh Moore 1f9d2442b9 Add Tensor.scatter_reduce (#8947)
* pytorch scatter -> scatter_reduce

* WIP scatter_reduce implementation

* _pre_scatter return type hint

* split out src, mask to satisfy linter

* Add src cast back in

* dict of lambdas instead of ifs

* sum and prod reduction ops with include_self

* add reduce arg error message

* add amax and amin reduction ops

* Fix include_self for higher dims

* Simplify

* Simplify amax and amin too

* Pull include_self logic out into _inv_mask function

* reduce arg cannot be None for scatter_reduce

* Fix self-mask issue

* Add mean reduce op

* Add tests

* any() not needed here

* remove comment

* End support for Tensor src with reduce arg in tinygrad scatter

* Process index, dim inside actual functions

* Add scatter_reduce to onnx

* Add excluded onnx ScatterElements reduction tests back in

* Save 2 lines on the mask helpers

* Update docs

* Add include_self=False tests

* cleanup

* Remove unneeded helper function

---------

Co-authored-by: chenyu <chenyu@fastmail.com>
2025-02-13 09:08:54 -05:00
..
2023-11-13 20:18:40 -08:00
2025-02-10 23:07:39 +03:00
2024-11-03 11:26:10 +08:00
2024-12-31 12:01:42 -05:00
2025-02-04 09:45:04 +08:00
2025-02-08 17:28:52 +08:00
2024-01-26 18:27:49 -08:00
2024-09-20 11:28:01 +08:00
2024-01-01 14:58:48 -08:00
2023-12-07 17:07:05 -08:00
2025-02-13 09:08:54 -05:00
2024-01-19 23:34:30 -05:00
2025-02-13 12:26:15 +08:00
2023-11-30 17:07:16 -08:00
2024-09-25 18:31:03 +08:00
2024-11-03 11:26:10 +08:00