Skip to content

Commit 6aa1ec8

Browse files
committed
Sync from upstream TF.
1 parent 1ed47b1 commit 6aa1ec8

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

tensorflow/lite/core/api/flatbuffer_conversions.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,10 @@ TfLiteStatus ParseOpDataTfLite(const Operator* op, BuiltinOperator op_type,
487487
return ParseRsqrt(op, error_reporter, allocator, builtin_data);
488488
}
489489

490+
case BuiltinOperator_SELECT: {
491+
return ParseSelect(op, error_reporter, allocator, builtin_data);
492+
}
493+
490494
case BuiltinOperator_SELECT_V2: {
491495
return ParseSelectV2(op, error_reporter, allocator, builtin_data);
492496
}
@@ -1004,7 +1008,6 @@ TfLiteStatus ParseOpDataTfLite(const Operator* op, BuiltinOperator op_type,
10041008
case BuiltinOperator_RELU_N1_TO_1:
10051009
case BuiltinOperator_RELU_0_TO_1:
10061010
case BuiltinOperator_SCATTER_ND:
1007-
case BuiltinOperator_SELECT:
10081011
case BuiltinOperator_SLICE:
10091012
case BuiltinOperator_TILE:
10101013
case BuiltinOperator_TOPK_V2:
@@ -2509,6 +2512,14 @@ TfLiteStatus ParseRsqrt(const Operator*, ErrorReporter*, BuiltinDataAllocator*,
25092512
return kTfLiteOk;
25102513
}
25112514

2515+
// We have this parse function instead of directly returning kTfLiteOk from the
2516+
// switch-case in ParseOpData because this function is used as part of the
2517+
// selective registration for the OpResolver implementation in micro.
2518+
TfLiteStatus ParseSelect(const Operator*, ErrorReporter*, BuiltinDataAllocator*,
2519+
void**) {
2520+
return kTfLiteOk;
2521+
}
2522+
25122523
// We have this parse function instead of directly returning kTfLiteOk from the
25132524
// switch-case in ParseOpData because this function is used as part of the
25142525
// selective registration for the OpResolver implementation in micro.

tensorflow/lite/core/api/flatbuffer_conversions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ TfLiteStatus ParseRound(const Operator* op, ErrorReporter* error_reporter,
333333
TfLiteStatus ParseRsqrt(const Operator* op, ErrorReporter* error_reporter,
334334
BuiltinDataAllocator* allocator, void** builtin_data);
335335

336+
TfLiteStatus ParseSelect(const Operator* op, ErrorReporter* error_reporter,
337+
BuiltinDataAllocator* allocator, void** builtin_data);
338+
336339
TfLiteStatus ParseSelectV2(const Operator* op, ErrorReporter* error_reporter,
337340
BuiltinDataAllocator* allocator,
338341
void** builtin_data);

tensorflow/lite/core/c/common.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,15 @@ typedef enum TfLiteDelegateFlags {
13521352
/// operator information using `Profiler::EventType::OPERATOR_INVOKE_EVENT`
13531353
/// and the results will appear in the operator-wise Profiling section and not
13541354
/// in the Delegate internal section.
1355-
kTfLiteDelegateFlagsPerOperatorProfiling = 4
1355+
kTfLiteDelegateFlagsPerOperatorProfiling = 4,
1356+
1357+
// This flag can be used by callers to hint that the delegate is likely to
1358+
// delegate the entire graph to a single delegate so certain allocations can
1359+
// be skipped.
1360+
// This is an ADVANCED feature and should only be used if the caller has
1361+
// prior knowledge that the delegate will fully delegate all subgraphs
1362+
// to a single delegate.
1363+
kTfLiteDelegateFlagsHintFullyDelegatedToSingleDelegate = 8,
13561364
} TfLiteDelegateFlags;
13571365

13581366
/// WARNING: This is an experimental interface that is subject to change.

0 commit comments

Comments
 (0)