diff --git a/compiler/luci/service/src/Nodes/CircleReshape.cpp b/compiler/luci/service/src/Nodes/CircleReshape.cpp index 0de10960b51..6e7baf74f87 100644 --- a/compiler/luci/service/src/Nodes/CircleReshape.cpp +++ b/compiler/luci/service/src/Nodes/CircleReshape.cpp @@ -87,6 +87,10 @@ loco::TensorShape Algorithm::visit(const luci::CircleReshape *node) for (uint32_t axis = 0; axis < shape_by_input.rank(); ++axis) { shape_by_input.dim(axis) = const_shape_node->at(axis); + if (const_shape_node->at(axis) < 0) + { + shape_by_input.dim(axis).unset(); + } } } else @@ -139,7 +143,7 @@ loco::TensorShape Algorithm::visit(const luci::CircleReshape *node) for (uint32_t dim_index = 0; dim_index < output_shape.rank(); ++dim_index) { const uint32_t dim_value = output_shape.dim(dim_index).value(); - if (static_cast(dim_value) == -1) + if (output_shape.dim(dim_index).known() == false) { LUCI_ASSERT(unknown_dim_index == UINT32_MAX, "More than one unknown dimension"); unknown_dim_index = dim_index;