-
Notifications
You must be signed in to change notification settings - Fork 157
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
[onert-micro] Reduce duplicate code in pool layers #12428
[onert-micro] Reduce duplicate code in pool layers #12428
Conversation
2b48924
to
0c74805
Compare
This commit reduces duplicate code in pool layers. - Introduce Pool2DCommon.h that has common functions for pool layers. - configure_kernel_CirclePool2DCommon : unifies configure function of pool layers. - createPoolParams : unifies creating parameters of pool layers. - Apply common function for pool layers. ONE-DCO-1.0-Signed-off-by: ragmani <ragmani0216@gmail.com>
0c74805
to
63d9907
Compare
inline luci_interpreter_pal::PoolParams createPoolParams(const circle::Operator *cur_op, | ||
BaseRuntimeGraph *runtime_graph) |
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.
I think it's better to pass const kernels::SISOKernel &siso_kernel
parameter here so as not to read the input and output tensor twice, since this has already been done in the calling function.
What do you think?)
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.
Do you mean to pass const kernels::SISOKernel &siso_kernel
instead of BaseRuntimeGraph *runtime_graph
? I think it looks better.
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.
Everything apart from one small comment looks great, thanks)
const auto input_index = cur_op->inputs()->operator[](0); | ||
const auto output_index = cur_op->outputs()->operator[](0); | ||
|
||
assert(input_index != -1); | ||
assert(output_index != -1); |
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.
so, now input_index and output_index can be removed, I think
90562d3
to
8b45469
Compare
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.
LGTM, thank you!
@chunseoklee, PTAL) |
This commit reduces duplicate code in pool layers.
ONE-DCO-1.0-Signed-off-by: ragmani ragmani0216@gmail.com
For #11744