Add a Stack operator
Context
The Stack operator is designed to be the counterpart of the Pop operator, which dictates its functionalities: at each time step
getNbRequiredData()
method, which specifies the amount of data consumed each time the operator is executed. Similarly, the Stack operator overrides the getNbRequiredMemory()
method, which specifies the amount of data produced by the operator with each execution.
A notable difference from the Pop operator is the way we define the output tensor's dimensions (which has to be done statically). For Pop, this is straightforward: we simply take the input tensor's dimensions and remove the first dimension. For Stack, however, we define an attribute representing the maximum number of elements to stack. Then, given the input tensor shape, the output tensor will have an additional first dimension corresponding to the maximum number of elements to stack.
Of course, care must be taken during the scheduling phase and execution to ensure that the operator is not invoked more times than the defined maximum.
Modified files
-
Stack.hpp
andStack.cpp
: Cpp implementation; -
Test_StackImpl.cpp
: Cpp unit tests; -
pybind_core.cpp
andpybind_Stack.cpp
: Added python bindings;
Detailed major modifications
TODO
-
C++ Implementation -
Tests -
Python bindings
Scheduling tests are needed, but will be done in aidge_backend_cpu
, as to have more flexibility (in particular, it would be interesting to test something like Pop->Dummy MetaOp->Stack and see how it goes).
Merge request reports
Activity
- Resolved by Jerome Hue
It seems like your are not using the attributes (forwardStep and maxElements) in the prodconso model. But then, it should be possible to avoid using them also in the implementation?
added 1 commit
- df0fccb3 - feat: Add python binding files for Stack operator
requested review from @olivierbichler
added Feature 🚀 label
added 1 commit
- e06633b4 - override updateConsumerProducer method in Stack operator
added 1 commit
- 7adf1431 - override updateConsumerProducer method in Stack operator
added 1 commit
- 982e64fd - chore: use forwardStep attribute in ProdConso model
assigned to @jeromeh
added TopicOperator label
added StatusReview Ready label
requested review from @pineapple
added 118 commits
-
982e64fd...1c1faf4b - 108 commits from branch
eclipse/aidge:dev
- 33c2fca9 - chore: Add a basic test for Pop Operator
- c85ae170 - feat: Stack operator
- c5f13c8e - chore: Update stack operator tests
- bec16dca - chore: Rework tests for stack operator
- 0f82d43c - chore: Improve stack operator test
- d22f9e54 - chore: Format files
- 35e45eeb - feat: Add python binding files for Stack operator
- dddb8ab3 - chore: Add pybind documentation
- 94230383 - override updateConsumerProducer method in Stack operator
- 744ae813 - chore: use forwardStep attribute in ProdConso model
Toggle commit list-
982e64fd...1c1faf4b - 108 commits from branch
enabled an automatic merge when all merge checks for 744ae813 pass
mentioned in commit efc3c4b5
mentioned in issue aidge#202 (closed)
mentioned in issue aidge#171