Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion tensorflow/lite/core/api/flatbuffer_conversions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ TfLiteStatus ParseOpDataTfLite(const Operator* op, BuiltinOperator op_type,
return ParseRsqrt(op, error_reporter, allocator, builtin_data);
}

case BuiltinOperator_SELECT: {
return ParseSelect(op, error_reporter, allocator, builtin_data);
}

case BuiltinOperator_SELECT_V2: {
return ParseSelectV2(op, error_reporter, allocator, builtin_data);
}
Expand Down Expand Up @@ -1004,7 +1008,6 @@ TfLiteStatus ParseOpDataTfLite(const Operator* op, BuiltinOperator op_type,
case BuiltinOperator_RELU_N1_TO_1:
case BuiltinOperator_RELU_0_TO_1:
case BuiltinOperator_SCATTER_ND:
case BuiltinOperator_SELECT:
case BuiltinOperator_SLICE:
case BuiltinOperator_TILE:
case BuiltinOperator_TOPK_V2:
Expand Down Expand Up @@ -2509,6 +2512,14 @@ TfLiteStatus ParseRsqrt(const Operator*, ErrorReporter*, BuiltinDataAllocator*,
return kTfLiteOk;
}

// We have this parse function instead of directly returning kTfLiteOk from the
// switch-case in ParseOpData because this function is used as part of the
// selective registration for the OpResolver implementation in micro.
TfLiteStatus ParseSelect(const Operator*, ErrorReporter*, BuiltinDataAllocator*,
void**) {
return kTfLiteOk;
}

// We have this parse function instead of directly returning kTfLiteOk from the
// switch-case in ParseOpData because this function is used as part of the
// selective registration for the OpResolver implementation in micro.
Expand Down
3 changes: 3 additions & 0 deletions tensorflow/lite/core/api/flatbuffer_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ TfLiteStatus ParseRound(const Operator* op, ErrorReporter* error_reporter,
TfLiteStatus ParseRsqrt(const Operator* op, ErrorReporter* error_reporter,
BuiltinDataAllocator* allocator, void** builtin_data);

TfLiteStatus ParseSelect(const Operator* op, ErrorReporter* error_reporter,
BuiltinDataAllocator* allocator, void** builtin_data);

TfLiteStatus ParseSelectV2(const Operator* op, ErrorReporter* error_reporter,
BuiltinDataAllocator* allocator,
void** builtin_data);
Expand Down
10 changes: 9 additions & 1 deletion tensorflow/lite/core/c/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,15 @@ typedef enum TfLiteDelegateFlags {
/// operator information using `Profiler::EventType::OPERATOR_INVOKE_EVENT`
/// and the results will appear in the operator-wise Profiling section and not
/// in the Delegate internal section.
kTfLiteDelegateFlagsPerOperatorProfiling = 4
kTfLiteDelegateFlagsPerOperatorProfiling = 4,

// This flag can be used by callers to hint that the delegate is likely to
// delegate the entire graph to a single delegate so certain allocations can
// be skipped.
// This is an ADVANCED feature and should only be used if the caller has
// prior knowledge that the delegate will fully delegate all subgraphs
// to a single delegate.
kTfLiteDelegateFlagsHintFullyDelegatedToSingleDelegate = 8,
} TfLiteDelegateFlags;

/// WARNING: This is an experimental interface that is subject to change.
Expand Down
Loading