Skip set_selected_impl() of post_optimize_weight when target generic layer is already created (#15852)

This commit is contained in:
Wilson Seok 2023-02-28 04:24:53 +09:00 committed by GitHub
parent d2a5be0ab8
commit 93a1be3607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,7 +54,7 @@ void post_optimize_weights::optimize_weights(T& node, program& p) {
// Don't run impl selection to avoid double compilation of reorder kernels
// in main program and internal program for constant propagation
if (!g_node.is_constant()) {
if ((!g_node.is_constant()) && (!reorder.second)) {
g_node.set_selected_impl(g_node.type()->choose_impl(g_node));
if (auto impl = g_node.get_selected_impl()) {
auto kernel_ids = p.get_kernels_cache().add_kernels_source(impl->get_kernels_source());