Skip to content

Commit

Permalink
skip optimization for dynamic tensors
Browse files Browse the repository at this point in the history
  • Loading branch information
mbencer committed Sep 23, 2024
1 parent 8976ecc commit c5ddcc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion runtime/onert/backend/cpu/ops/ExpandDimsLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void ExpandDimsLayer::configure(const IPortableTensor *input, IPortableTensor *o
void ExpandDimsLayer::run()
{
bool optimization_applied = false;
if ((1 == _input_consumers_number) && !_input->has_padding())
if ((1 == _input_consumers_number) && !_input->has_padding() && !_output->is_dynamic())
{
optimization_applied = try_assign_buffer(_input, _output);
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/cpu/ops/ReshapeLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ReshapeLayer::ReshapeLayer() : _input(nullptr), _shape(nullptr), _output(nullptr
void ReshapeLayer::reshapeGeneric()
{
bool optimization_applied = false;
if ((1 == _input_consumers_number) && !_input->has_padding())
if ((1 == _input_consumers_number) && !_input->has_padding() && !_output->is_dynamic())
{
optimization_applied = try_assign_buffer(_input, _output);
}
Expand Down

0 comments on commit c5ddcc5

Please sign in to comment.