Fix error in perpare_buffer_fusing w.r.t accessing invalid output layout (#13723)

This commit is contained in:
Taylor Yeonbok Lee 2022-10-29 00:00:09 -07:00 committed by GitHub
parent bb296fcb11
commit 454bc61018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ void concat_input_order::run(program& p) {
// 4. Not already aligned
// 5. Users can accept shuffled features
// 6. No fused primitives
if (!node->is_type<concatenation>() || node->is_output() || node->is_dynamic())
if (!node->is_type<concatenation>() || node->is_output() || (node->is_valid_output_layout() && node->is_dynamic()))
continue;
auto& concat_node = node->as<concatenation>();

View File

@ -311,7 +311,7 @@ void prepare_buffer_fusing::run(program& p) {
If crop is before concat there can be padding mismtach, since concat changes padding.
*/
auto can_optimize = [](const program_node* node) {
if (node->is_dynamic() || node->is_output() || (!node->get_fused_activations_funcs().empty())) {
if ((node->is_valid_output_layout() && node->is_dynamic()) || node->is_output() || (!node->get_fused_activations_funcs().empty())) {
return false;
}
return true;