-
Notifications
You must be signed in to change notification settings - Fork 2
ReduceSum Layer #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReduceSum Layer #187
Conversation
include/layers/ReduceSumLayer.hpp
Outdated
| #include "layers/Layer.hpp" | ||
| #include "layers/Tensor.hpp" | ||
|
|
||
| namespace itlab_2023 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change namespace as in the last PR
include/layers/ReduceSumLayer.hpp
Outdated
|
|
||
| namespace itlab_2023 { | ||
|
|
||
| class ReduceSumLayer : public Layer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Reduce op and inside it use sum, avg, mult etc
|
Uses 1-based indexing which differs from NumPy/PyTorch conventions (0-based). This could confuse users familiar with other frameworks. Recommendation: Consider switching to 0-based indexing. |
|
Add Negative Axis Support |
aobolensk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we enumerate axis from 1 instead of 0?
src/layers/ReduceSumLayer.cpp
Outdated
| for (size_t i = input_rank - 1;; --i) { | ||
| ++in_coords[i]; | ||
| if (in_coords[i] < input_shape[i] || i == 0) { | ||
| break; | ||
| } | ||
| in_coords[i] = 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop is risky, you check that i > 0 after accessing i-th element.
No description provided.