1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
--- components/optimization_guide/core/tflite_model_executor.h.orig 2024-01-30 07:53:34 UTC
+++ components/optimization_guide/core/tflite_model_executor.h
@@ -241,7 +241,11 @@ class TFLiteModelExecutor : public ModelExecutor<Outpu
void SendForBatchExecution(
BatchExecutionCallback callback_on_complete,
base::TimeTicks start_time,
+#if defined(__clang__) && (__clang_major__ >= 15)
ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
+#else
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
+#endif
override {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -263,7 +267,11 @@ class TFLiteModelExecutor : public ModelExecutor<Outpu
// Starts the synchronous execution of the model. Returns model outputs.
// Model needs to be loaded. Synchronous calls do not load or unload model.
std::vector<absl::optional<OutputType>> SendForBatchExecutionSync(
+#if defined(__clang__) && (__clang_major__ >= 15)
ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
+#else
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
+#endif
override {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -421,7 +429,11 @@ class TFLiteModelExecutor : public ModelExecutor<Outpu
// executes it on the model execution thread.
void LoadModelFileAndBatchExecute(
BatchExecutionCallback callback_on_complete,
+#if defined(__clang__) && (__clang_major__ >= 15)
ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs) {
+#else
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs) {
+#endif
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -438,7 +450,11 @@ class TFLiteModelExecutor : public ModelExecutor<Outpu
// Batch executes the loaded model for inputs.
void BatchExecuteLoadedModel(
+#if defined(__clang__) && (__clang_major__ >= 15)
ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
+#else
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
+#endif
std::vector<absl::optional<OutputType>>* outputs) {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -498,7 +514,11 @@ class TFLiteModelExecutor : public ModelExecutor<Outpu
// Unloads the model if needed.
void BatchExecuteLoadedModelAndRunCallback(
BatchExecutionCallback callback_on_complete,
+#if defined(__clang__) && (__clang_major__ >= 15)
ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
+#else
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
+#endif
ExecutionStatus execution_status) {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|