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.
Stack.hpp
and Stack.cpp
: Cpp implementation;Test_StackImpl.cpp
: Cpp unit tests;pybind_core.cpp
and pybind_Stack.cpp
: Added 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).
Copyright © Eclipse Foundation, Inc. All Rights Reserved. Privacy Policy | Terms of Use | Copyright Agent