[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] Documentation changes
[ ] Other (please describe):
What is the current behavior?
Event.fill_tensor(binning_mode="SUM") was not summing events to each pixel, it was behaving the same way as the "OR" operation
What is the new behavior?
Now, the operation correctly add multiple event per pixels when needed.
Does this introduce a breaking change?
[ ] Yes
[X] No
Supplemental information
The implementation uses np.add.at because torch introduced the function torch.index_add only in versions >= 2.0 and I didn't want to introduce versioning issues.
Issue Number: #235
Objective of pull request: Fix the bug of Event.fill_tensor(binning_mode="SUM") which was not performing as expected.
Pull request checklist
Your PR fulfills the following requirements:
flakeheaven lint src/lava tests/
) and (bandit -r src/lava/.
) pass locallypytest
) passes locallyPull request type
Please check your PR type:What is the current behavior?
What is the new behavior?
Does this introduce a breaking change?
Supplemental information
The implementation uses np.add.at because torch introduced the function torch.index_add only in versions >= 2.0 and I didn't want to introduce versioning issues.