From dee348ba4b5fb59ad7f41968d3197ea83a5341f1 Mon Sep 17 00:00:00 2001 From: Alexander Bengtsson Date: Fri, 11 Apr 2025 10:38:26 +0200 Subject: [PATCH] MLBEDSW-10690: Add OpType::MemoryCopy to supported-operators - Add MemoryCopy as a supported-operator as reshape-removal (which runs before supported operator-checks) introduced memorycopies - Resolves assert for reshape-like operations Change-Id: Ic7a2e76feb1ddfb3c5cda42f1715a149c1914a36 Signed-off-by: Alexander Bengtsson --- ethosu/regor/tflite/tflite_supported_operators.cpp | 1 + ethosu/regor/tflite/tflite_supported_operators_u55.cpp | 2 ++ ethosu/regor/tflite/tflite_supported_operators_u85.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/ethosu/regor/tflite/tflite_supported_operators.cpp b/ethosu/regor/tflite/tflite_supported_operators.cpp index 90e7bd10..4890bf7a 100644 --- a/ethosu/regor/tflite/tflite_supported_operators.cpp +++ b/ethosu/regor/tflite/tflite_supported_operators.cpp @@ -164,6 +164,7 @@ bool TfLiteSupportedOperators::ConstraintTensQuantized(const Operation *op) case OpType::ReduceAll: case OpType::ReduceAny: case OpType::ExpandDims: + case OpType::MemoryCopy: return true; default: break; diff --git a/ethosu/regor/tflite/tflite_supported_operators_u55.cpp b/ethosu/regor/tflite/tflite_supported_operators_u55.cpp index c0cfa418..c5aa7fce 100644 --- a/ethosu/regor/tflite/tflite_supported_operators_u55.cpp +++ b/ethosu/regor/tflite/tflite_supported_operators_u55.cpp @@ -77,6 +77,7 @@ TfLiteSupportedOperatorsU55::TfLiteSupportedOperatorsU55(IArchitectureConstraint OpType::SplitV, OpType::Quantize, OpType::HardSwish, + OpType::MemoryCopy, // clang-format on }; _supportedDataTypes = { @@ -297,6 +298,7 @@ bool TfLiteSupportedOperatorsU55::Constraint32bitOps(const Operation *op) OpType::Squeeze, OpType::ExpandDims, OpType::Identity, + OpType::MemoryCopy, }; OpType opType = op->Type(); diff --git a/ethosu/regor/tflite/tflite_supported_operators_u85.cpp b/ethosu/regor/tflite/tflite_supported_operators_u85.cpp index 67e89983..79f9d44d 100644 --- a/ethosu/regor/tflite/tflite_supported_operators_u85.cpp +++ b/ethosu/regor/tflite/tflite_supported_operators_u85.cpp @@ -100,6 +100,7 @@ TfLiteSupportedOperatorsU85::TfLiteSupportedOperatorsU85(IArchitectureConstraint OpType::SelectV2, OpType::BatchMatMul, OpType::ReduceAll, + OpType::MemoryCopy, // clang-format on }; _supportedDataTypes = { -- GitLab