/external/tensorflow/tensorflow/lite/kernels/ |
D | subgraph_test_util_test.cc | 37 : interpreter_(new Interpreter), builder_(new SubgraphBuilder) {} in SubgraphBuilderTest() 40 interpreter_.reset(); in ~SubgraphBuilderTest() 47 interpreter_.reset(new Interpreter); in TestAccumulateLoopBody() 49 &interpreter_->primary_subgraph()); in TestAccumulateLoopBody() 51 interpreter_->ResizeInputTensor(interpreter_->inputs()[0], {1}); in TestAccumulateLoopBody() 52 interpreter_->ResizeInputTensor(interpreter_->inputs()[1], {1}); in TestAccumulateLoopBody() 53 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in TestAccumulateLoopBody() 55 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[0]), {input1}); in TestAccumulateLoopBody() 56 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[1]), {input2}); in TestAccumulateLoopBody() 58 ASSERT_EQ(interpreter_->Invoke(), kTfLiteOk); in TestAccumulateLoopBody() [all …]
|
D | while_test.cc | 45 interpreter_.reset(new Interpreter); in TEST_F() 46 interpreter_->AddSubgraphs(2); in TEST_F() 47 builder_->BuildLessEqualCondSubgraph(interpreter_->subgraph(1), i); in TEST_F() 48 builder_->BuildAccumulateLoopBodySubgraph(interpreter_->subgraph(2)); in TEST_F() 49 builder_->BuildWhileSubgraph(&interpreter_->primary_subgraph()); in TEST_F() 51 interpreter_->ResizeInputTensor(interpreter_->inputs()[0], {1}); in TEST_F() 52 interpreter_->ResizeInputTensor(interpreter_->inputs()[1], {1}); in TEST_F() 53 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in TEST_F() 54 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[0]), {1}); in TEST_F() 55 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[1]), {1}); in TEST_F() [all …]
|
D | if_test.cc | 39 interpreter_->AddSubgraphs(2); in SetUp() 40 builder_->BuildAddSubgraph(interpreter_->subgraph(1)); in SetUp() 41 builder_->BuildMulSubgraph(interpreter_->subgraph(2)); in SetUp() 42 builder_->BuildIfSubgraph(&interpreter_->primary_subgraph()); in SetUp() 44 interpreter_->ResizeInputTensor(interpreter_->inputs()[0], {1}); in SetUp() 45 interpreter_->ResizeInputTensor(interpreter_->inputs()[1], {2}); in SetUp() 46 interpreter_->ResizeInputTensor(interpreter_->inputs()[2], {1, 2}); in SetUp() 47 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in SetUp() 49 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[1]), {5, 7}); in SetUp() 50 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[2]), {1, 2}); in SetUp() [all …]
|
D | variable_ops_test.cc | 54 ASSERT_EQ(interpreter_.AddTensors(4, &first_new_tensor_index), kTfLiteOk); in ConstructGraph() 55 ASSERT_EQ(interpreter_.SetInputs({0, 1, 2}), kTfLiteOk); in ConstructGraph() 56 ASSERT_EQ(interpreter_.SetOutputs({3}), kTfLiteOk); in ConstructGraph() 57 interpreter_.SetTensorParametersReadWrite(0, kTfLiteInt32, "", 0, nullptr, in ConstructGraph() 59 interpreter_.SetTensorParametersReadWrite(1, kTfLiteInt32, "", 0, nullptr, in ConstructGraph() 61 interpreter_.SetTensorParametersReadWrite(2, kTfLiteFloat32, "", 0, nullptr, in ConstructGraph() 63 interpreter_.SetTensorParametersReadWrite(3, kTfLiteFloat32, "", 0, nullptr, in ConstructGraph() 66 interpreter_.AddNodeWithParameters({0, 2}, {}, nullptr, 0, nullptr, in ConstructGraph() 68 interpreter_.AddNodeWithParameters({1}, {3}, nullptr, 0, nullptr, in ConstructGraph() 73 Interpreter interpreter_; member in tflite::__anonc43372260111::VariableOpsTest [all …]
|
D | call_once_test.cc | 35 interpreter_->AddSubgraphs(1); in SetUp() 37 &interpreter_->primary_subgraph()); in SetUp() 39 interpreter_->subgraph(1)); in SetUp() 41 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in SetUp() 46 ASSERT_EQ(interpreter_->Invoke(), kTfLiteOk); in TEST_F() 48 TfLiteTensor* output = interpreter_->tensor(interpreter_->outputs()[0]); in TEST_F() 60 ASSERT_EQ(interpreter_->Invoke(), kTfLiteOk); in TEST_F() 62 TfLiteTensor* output = interpreter_->tensor(interpreter_->outputs()[0]); in TEST_F() 76 ASSERT_EQ(interpreter_->Invoke(), kTfLiteOk); in TEST_F() 77 TfLiteTensor* output = interpreter_->tensor(interpreter_->outputs()[0]); in TEST_F()
|
/external/tensorflow/tensorflow/lite/delegates/ |
D | delegate_test.cc | 47 EXPECT_EQ(interpreter_->ModifyGraphWithDelegate(nullptr), in TEST_F() 53 interpreter_->ModifyGraphWithDelegate(delegate_->get_tf_lite_delegate()); in TEST_F() 55 ASSERT_EQ(interpreter_->execution_plan().size(), 1); in TEST_F() 56 int node = interpreter_->execution_plan()[0]; in TEST_F() 57 const auto* node_and_reg = interpreter_->node_and_registration(node); in TEST_F() 83 interpreter_->ModifyGraphWithDelegate(delegate_->get_tf_lite_delegate()), in TEST_F() 86 ASSERT_EQ(interpreter_->execution_plan().size(), 3); in TEST_F() 91 TfLiteTensor* tensor = interpreter_->tensor(kOutputTensorIndex); in TEST_F() 94 memcpy(interpreter_->typed_tensor<float>(0), input.data(), 3 * sizeof(float)); in TEST_F() 95 memcpy(interpreter_->typed_tensor<float>(1), input.data(), 3 * sizeof(float)); in TEST_F() [all …]
|
D | interpreter_utils_test.cc | 42 interpreter_->ModifyGraphWithDelegate(delegate_->get_tf_lite_delegate()), in TEST_F() 45 ASSERT_EQ(interpreter_->execution_plan().size(), 1); in TEST_F() 51 memcpy(interpreter_->typed_tensor<float>(0), input.data(), 3 * sizeof(float)); in TEST_F() 52 memcpy(interpreter_->typed_tensor<float>(1), input.data(), 3 * sizeof(float)); in TEST_F() 54 delegates::InterpreterUtils::InvokeWithCPUFallback(interpreter_.get()), in TEST_F() 57 ASSERT_EQ(interpreter_->execution_plan().size(), 3); in TEST_F() 59 TfLiteTensor* tensor = interpreter_->tensor(kOutputTensorIndex); in TEST_F() 76 ASSERT_EQ(interpreter_->execution_plan().size(), 3); in TEST_F() 78 interpreter_->ModifyGraphWithDelegate(delegate_->get_tf_lite_delegate()), in TEST_F() 81 interpreter_->ModifyGraphWithDelegate(delegate2_->get_tf_lite_delegate()), in TEST_F() [all …]
|
D | delegate_test_util.cc | 93 interpreter_.reset(new Interpreter); in SetUp() 94 SetUpSubgraph(&interpreter_->primary_subgraph()); in SetUp() 126 interpreter_.reset(); in TearDown() 332 interpreter_.reset(new Interpreter); in SetUp() 333 interpreter_->AddTensors(13); in SetUp() 334 interpreter_->SetInputs({0}); in SetUp() 335 interpreter_->SetOutputs({12}); in SetUp() 342 interpreter_->SetTensorParametersReadWrite(0, kTfLiteFloat32, "", {1}, quant); in SetUp() 344 interpreter_->SetTensorParametersReadOnly( in SetUp() 347 interpreter_->SetTensorParametersReadWrite(2, kTfLiteFloat32, "", {1}, quant); in SetUp() [all …]
|
/external/tensorflow/tensorflow/lite/delegates/utils/ |
D | simple_delegate_test.cc | 30 interpreter_.reset(new Interpreter); in SetUp() 31 interpreter_->AddTensors(5); in SetUp() 32 interpreter_->SetInputs({0, 1}); in SetUp() 33 interpreter_->SetOutputs({3, 4}); in SetUp() 35 interpreter_->SetTensorParametersReadWrite(0, kTfLiteFloat32, "", {3}, in SetUp() 37 interpreter_->SetTensorParametersReadWrite(1, kTfLiteFloat32, "", {3}, in SetUp() 39 interpreter_->SetTensorParametersReadWrite(2, kTfLiteFloat32, "", {3}, in SetUp() 41 interpreter_->SetTensorParametersReadWrite(3, kTfLiteFloat32, "", {3}, in SetUp() 43 interpreter_->SetTensorParametersReadWrite(4, kTfLiteFloat32, "", {3}, in SetUp() 49 interpreter_->AddNodeWithParameters({0, 0}, {2}, nullptr, 0, builtin_data_1, in SetUp() [all …]
|
/external/tensorflow/tensorflow/lite/profiling/ |
D | profile_summarizer_test.cc | 81 tflite::Interpreter* GetInterpreter() { return interpreter_.get(); } in GetInterpreter() 156 interpreter_->AddSubgraphs(2); in SetUp() 157 builder_->BuildAddSubgraph(interpreter_->subgraph(1)); in SetUp() 158 builder_->BuildMulSubgraph(interpreter_->subgraph(2)); in SetUp() 159 builder_->BuildIfSubgraph(&interpreter_->primary_subgraph()); in SetUp() 161 interpreter_->ResizeInputTensor(interpreter_->inputs()[0], {1}); in SetUp() 162 interpreter_->ResizeInputTensor(interpreter_->inputs()[1], {2}); in SetUp() 163 interpreter_->ResizeInputTensor(interpreter_->inputs()[2], {1, 2}); in SetUp() 164 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in SetUp() 167 interpreter_->tensor(interpreter_->inputs()[1]), {5, 7}); in SetUp() [all …]
|
/external/tensorflow/tensorflow/lite/ |
D | interpreter_test.cc | 1129 ASSERT_EQ(interpreter_.SetNumThreads(4), kTfLiteOk); in TEST_F() 1133 ASSERT_EQ(interpreter_.SetNumThreads(4), kTfLiteOk); in TEST_F() 1134 ASSERT_EQ(interpreter_.SetNumThreads(5), kTfLiteOk); in TEST_F() 1140 ASSERT_EQ(interpreter_.SetNumThreads(-2), kTfLiteError); in TEST_F() 1143 ASSERT_EQ(interpreter_.SetNumThreads(-1), kTfLiteOk); in TEST_F() 1148 ASSERT_EQ(interpreter_.SetNumThreads(4), kTfLiteOk); in TEST_F() 1242 ASSERT_EQ(interpreter_.AddNodeWithParameters( in MakeCopyNode() 1246 ASSERT_EQ(interpreter_.ResizeInputTensor(input, {3}), kTfLiteOk); in MakeCopyNode() 1251 ASSERT_EQ(interpreter_.AddTensors(4), kTfLiteOk); in SetUp() 1252 interpreter_.SetInputs({0, 1}); in SetUp() [all …]
|
D | interpreter_test_util.h | 43 TfLiteContext* GetInterpreterContext() { return interpreter_.context_; } in GetInterpreterContext() 47 return &interpreter_.lazy_delegate_providers_; in mutable_lazy_delegate_providers() 50 bool HasDelegates() { return interpreter_.HasDelegates(); } in HasDelegates() 60 interpreter_.SetSignatureDef({signature}); in BuildSignature() 63 Interpreter interpreter_; variable
|
/external/tensorflow/tensorflow/lite/tools/evaluation/stages/ |
D | tflite_inference_stage.cc | 44 model_info_ = GetTfliteModelInfo(*interpreter_); in UpdateModelInfo() 47 outputs_.reserve(interpreter_->outputs().size()); in UpdateModelInfo() 48 for (int i : interpreter_->outputs()) { in UpdateModelInfo() 49 TfLiteTensor* tensor = interpreter_->tensor(i); in UpdateModelInfo() 56 const std::vector<int>& intepreter_inputs = interpreter_->inputs(); in ResizeInputs() 64 TfLiteTensor* t = interpreter_->tensor(i); in ResizeInputs() 66 TF_LITE_ENSURE_STATUS(interpreter_->ResizeInputTensor(i, shapes[j])); in ResizeInputs() 70 TF_LITE_ENSURE_STATUS(interpreter_->AllocateTensors()); in ResizeInputs() 77 if (!interpreter_) { in ApplyCustomDelegate() 89 interpreter_->ModifyGraphWithDelegate(delegates_.back().get())); in ApplyCustomDelegate() [all …]
|
/external/tensorflow/tensorflow/lite/delegates/gpu/common/ |
D | model_builder_test.cc | 145 TfLiteContext* context() { return interpreter_.primary_subgraph().context(); } in context() 159 interpreter_.primary_subgraph().node_and_registration(index); in node() 164 interpreter_.primary_subgraph().node_and_registration(index); in registration() 177 Interpreter interpreter_; member in tflite::gpu::__anona5beb0730111::DelegatedInterpreter 194 EXPECT_EQ(interpreter_.AddTensors(5), kTfLiteOk); in InterpreterFp16() 195 EXPECT_EQ(interpreter_.SetInputs({0, 1}), kTfLiteOk); in InterpreterFp16() 196 EXPECT_EQ(interpreter_.SetOutputs({4}), kTfLiteOk); in InterpreterFp16() 201 EXPECT_EQ(interpreter_.AddNodeWithParameters( in InterpreterFp16() 210 EXPECT_EQ(interpreter_.AddNodeWithParameters( in InterpreterFp16() 228 EXPECT_EQ(interpreter_.AddNodeWithParameters( in InterpreterFp16() [all …]
|
/external/tensorflow/tensorflow/lite/kernels/hashtable/ |
D | hashtable_ops_test.cc | 116 interpreter_ = absl::make_unique<Interpreter>(&error_reporter_); in HashtableGraph() 126 interpreter_->AddNodeWithParameters( in BuildDefaultGraph() 132 interpreter_->AddNodeWithParameters( in BuildDefaultGraph() 137 interpreter_->AddNodeWithParameters( in BuildDefaultGraph() 143 interpreter_->AddNodeWithParameters( in BuildDefaultGraph() 153 interpreter_->AddNodeWithParameters( in BuildNoImportGraph() 159 interpreter_->AddNodeWithParameters( in BuildNoImportGraph() 165 interpreter_->AddNodeWithParameters( in BuildNoImportGraph() 175 interpreter_->AddNodeWithParameters( in BuildImportTwiceGraph() 181 interpreter_->AddNodeWithParameters( in BuildImportTwiceGraph() [all …]
|
/external/tensorflow/tensorflow/lite/python/interpreter_wrapper/ |
D | interpreter_wrapper.cc | 43 if (i >= interpreter_->tensors_size() || i < 0) { \ 46 interpreter_->tensors_size()); \ 51 if (i >= interpreter_->nodes_size() || i < 0) { \ 57 if (!interpreter_) { \ 207 interpreter_(std::move(interpreter)) {} in InterpreterWrapper() 213 TFLITE_PY_CHECK(interpreter_->AllocateTensors()); in AllocateTensors() 223 status_code = interpreter_->Invoke(); in Invoke() 234 PyObject* np_array = PyArrayFromIntVector(interpreter_->inputs().data(), in InputIndices() 235 interpreter_->inputs().size()); in InputIndices() 241 PyObject* np_array = PyArrayFromIntVector(interpreter_->outputs().data(), in OutputIndices() [all …]
|
/external/tensorflow/tensorflow/lite/tools/serialization/ |
D | writer_lib_test.cc | 435 interpreter_.reset(new Interpreter); in TEST_F() 436 interpreter_->AddSubgraphs(2); in TEST_F() 437 builder_->BuildLessEqualCondSubgraph(interpreter_->subgraph(1), kSeqNumber); in TEST_F() 438 builder_->BuildAccumulateLoopBodySubgraph(interpreter_->subgraph(2)); in TEST_F() 439 builder_->BuildWhileSubgraph(&interpreter_->primary_subgraph()); in TEST_F() 441 interpreter_->ResizeInputTensor(interpreter_->inputs()[0], {1}); in TEST_F() 442 interpreter_->ResizeInputTensor(interpreter_->inputs()[1], {1}); in TEST_F() 443 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in TEST_F() 444 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[0]), {1}); in TEST_F() 449 NewCustomAlloc(interpreter_->tensor(interpreter_->inputs()[1])->bytes, in TEST_F() [all …]
|
/external/tensorflow/tensorflow/lite/delegates/flex/ |
D | test_util.cc | 26 bool FlexModelTest::Invoke() { return interpreter_->Invoke() == kTfLiteOk; } in Invoke() 34 dynamic_buffer.WriteToTensor(interpreter_->tensor(tensor_index), in SetStringValues() 41 TfLiteTensor* tensor = interpreter_->tensor(tensor_index); in GetStringValues() 52 ASSERT_EQ(interpreter_->ResizeInputTensor(tensor_index, values), kTfLiteOk); in SetShape() 53 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in SetShape() 58 auto* dims = interpreter_->tensor(tensor_index)->dims; in GetShape() 67 return interpreter_->tensor(tensor_index)->type; in GetType() 71 return interpreter_->tensor(tensor_index)->allocation_type == kTfLiteDynamic; in IsDynamicTensor() 77 interpreter_->AddTensors(num_tensors); in AddTensors() 85 CHECK_EQ(interpreter_->SetTensorParametersReadWrite(i, type, in AddTensors() [all …]
|
/external/tflite-support/tensorflow_lite_support/cc/port/default/ |
D | tflite_wrapper.h | 66 tflite::Interpreter& operator*() { return *interpreter_; } 67 tflite::Interpreter* operator->() { return interpreter_.get(); } 68 tflite::Interpreter& operator*() const { return *interpreter_; } 69 tflite::Interpreter* operator->() const { return interpreter_.get(); } 70 tflite::Interpreter* get() const { return interpreter_.get(); } in get() 76 std::unique_ptr<tflite::Interpreter> interpreter_;
|
D | tflite_wrapper.cc | 33 RETURN_IF_ERROR(interpreter_initializer(&interpreter_)); in InitializeWithFallback() 34 return interpreter_->AllocateTensors() != kTfLiteOk in InitializeWithFallback() 43 RETURN_IF_ERROR(set_inputs(interpreter_.get())); in InvokeWithFallback() 44 return interpreter_->Invoke() != kTfLiteOk in InvokeWithFallback() 50 return interpreter_->Invoke() != kTfLiteOk in InvokeWithoutFallback()
|
/external/tensorflow/tensorflow/lite/delegates/hexagon/builders/tests/ |
D | batch_seq_config_test.cc | 100 InterpreterBuilder(*model_, *resolver_)(&interpreter_); in Init() 101 ASSERT_TRUE(interpreter_ != nullptr); in Init() 127 ASSERT_TRUE(interpreter_->ModifyGraphWithDelegate(delegate_.get()) == in ApplyDelegate() 134 auto interpreter_inputs = interpreter_->inputs(); in Run() 135 interpreter_->ResizeInputTensor(interpreter_inputs[0], input_shape); in Run() 136 ASSERT_EQ(kTfLiteOk, interpreter_->AllocateTensors()); in Run() 139 interpreter_->tensor(interpreter_->inputs()[0]); in Run() 143 ASSERT_EQ(kTfLiteOk, interpreter_->Invoke()); in Run() 147 auto* tensor = interpreter_->output_tensor(output_index); in GetOutput() 148 uint8* data = interpreter_->typed_output_tensor<uint8>(output_index); in GetOutput() [all …]
|
D | hexagon_delegate_op_model.h | 61 ASSERT_TRUE(interpreter_ != nullptr); in ApplyDelegateAndInvoke() 63 EXPECT_TRUE(interpreter_->ModifyGraphWithDelegate(delegate_.get()) != in ApplyDelegateAndInvoke() 66 ASSERT_EQ(1, interpreter_->execution_plan().size()); in ApplyDelegateAndInvoke() 67 const int node = interpreter_->execution_plan()[0]; in ApplyDelegateAndInvoke() 68 const auto* node_and_reg = interpreter_->node_and_registration(node); in ApplyDelegateAndInvoke()
|
/external/tensorflow/tensorflow/lite/micro/benchmarks/ |
D | micro_benchmark.h | 38 : interpreter_(GetModel(model), *op_resolver, tensor_arena, in MicroBenchmarkRunner() 40 interpreter_.AllocateTensors(); in MicroBenchmarkRunner() 45 TfLiteStatus invoke_status = interpreter_.Invoke(); in RunSingleIteration() 54 TfLiteTensor* input = interpreter_.input(0); in SetRandomInput() 68 TfLiteTensor* input = interpreter_.input(0); in SetInput() 77 tflite::MicroInterpreter interpreter_;
|
/external/tensorflow/tensorflow/lite/testing/nnapi_tflite_zip_tests/ |
D | tflite_driver.cc | 216 interpreter_.reset(); in ~TfLiteDriver() 221 if (interpreter_->AllocateTensors() != kTfLiteOk) { in AllocateTensors() 238 InterpreterBuilder(*model_, *resolver_)(&interpreter_); in LoadModel() 239 if (!interpreter_) { in LoadModel() 245 if (interpreter_->ModifyGraphWithDelegate(delegate_.get()) != kTfLiteOk) { in LoadModel() 257 auto* tensor = interpreter_->tensor(id); in ResetTensor() 263 if (interpreter_->ResizeInputTensor( in ReshapeTensor() 273 auto* tensor = interpreter_->tensor(id); in SetInput() 317 auto* tensor = interpreter_->tensor(id); in SetExpectation() 350 if (interpreter_->ModifyGraphWithDelegate(NnApiDelegate()) != kTfLiteOk) { in Invoke() [all …]
|
/external/tensorflow/tensorflow/lite/python/optimize/ |
D | calibration_wrapper.cc | 40 if (!interpreter_) { \ 150 : interpreter_(std::move(interpreter)), in CalibrationWrapper() 161 TFLITE_PY_CHECK(interpreter_->AllocateTensors()); in Prepare() 162 TFLITE_PY_CHECK(interpreter_->ResetVariableTensors()); in Prepare() 175 if (inputs_size != interpreter_->inputs().size()) { in Prepare() 178 interpreter_->inputs().size(), inputs_size); in Prepare() 194 int input_tensor_idx = interpreter_->inputs()[i]; in Prepare() 195 if (interpreter_->ResizeInputTensor(input_tensor_idx, dims) != kTfLiteOk) { in Prepare() 214 if (inputs_size != interpreter_->inputs().size()) { in FeedTensor() 217 interpreter_->inputs().size(), inputs_size); in FeedTensor() [all …]
|