diff --git a/ethosu/regor/compiler/graphir_optimiser.cpp b/ethosu/regor/compiler/graphir_optimiser.cpp index 565535eee6b48d263e3b7d5804528a09937f4595..0f00be0bd878575662e0a30f72a098a53b5aa958 100644 --- a/ethosu/regor/compiler/graphir_optimiser.cpp +++ b/ethosu/regor/compiler/graphir_optimiser.cpp @@ -1123,8 +1123,8 @@ Operation *GraphIrOptimiser::RewriteCast(Graph *const, Operation *const operatio { // Replace CAST with ADD auto copyOp = std::make_shared(OpType::Add); - copyOp->ConnectInput(TensorUsage::IFM1, CreateConstTensor("const_zero", ifmConn->tensor->Type(), 0)); ReplaceOperation(operation, copyOp.get()); + copyOp->ConnectInput(TensorUsage::IFM1, CreateConstTensor("const_zero", ifmConn->tensor->Type(), 0)); RecordOptimisation(operation, copyOp.get()); returnOp = copyOp.get();