File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -700,7 +700,8 @@ class Delegate {
700700 }
701701
702702 bool enable_subgraph_reshaping () const {
703- return true ;
703+ return (options_.flags &
704+ TFLITE_XNNPACK_DELEGATE_FLAG_DISABLE_SUBGRAPH_RESHAPING) == 0 ;
704705 }
705706
706707 bool enable_slinky () const {
Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ extern "C" {
5656// to avoid using faster codepaths that are numerically inconsistent with any
5757// other codepath that could be used in the same compiled delegate.
5858#define TFLITE_XNNPACK_DELEGATE_FLAG_SLOW_CONSISTENT_ARITHMETIC 0x00000200
59+ // Disable XNNPack subgraph reshaping. This means that models with dynamic
60+ // tensors are not supported.
61+ #define TFLITE_XNNPACK_DELEGATE_FLAG_DISABLE_SUBGRAPH_RESHAPING 0x00000400
5962
6063struct TfLiteXNNPackDelegateWeightsCache ;
6164
@@ -74,6 +77,7 @@ typedef struct {
7477 // - TFLITE_XNNPACK_DELEGATE_FLAG_TRANSIENT_INDIRECTION_BUFFER
7578 // - TFLITE_XNNPACK_DELEGATE_FLAG_ENABLE_LATEST_OPERATORS
7679 // - TFLITE_XNNPACK_DELEGATE_FLAG_ENABLE_SUBGRAPH_RESHAPING
80+ // - TFLITE_XNNPACK_DELEGATE_FLAG_DISABLE_SUBGRAPH_RESHAPING
7781 // - TFLITE_XNNPACK_DELEGATE_FLAG_SLOW_CONSISTENT_ARITHMETIC
7882 uint32_t flags ;
7983 // Cache for packed weights, can be shared between multiple instances of
You can’t perform that action at this time.
0 commit comments