/external/tensorflow/tensorflow/lite/kernels/ |
D | subgraph_test_util_test.cc | 31 : interpreter_(new Interpreter), builder_(new SubgraphBuilder) {} in SubgraphBuilderTest() 34 interpreter_.reset(); in ~SubgraphBuilderTest() 41 interpreter_.reset(new Interpreter); in TestAccumelateLoopBody() 43 &interpreter_->primary_subgraph()); in TestAccumelateLoopBody() 45 interpreter_->ResizeInputTensor(interpreter_->inputs()[0], {1}); in TestAccumelateLoopBody() 46 interpreter_->ResizeInputTensor(interpreter_->inputs()[1], {1}); in TestAccumelateLoopBody() 47 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in TestAccumelateLoopBody() 49 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[0]), {input1}); in TestAccumelateLoopBody() 50 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[1]), {input2}); in TestAccumelateLoopBody() 52 ASSERT_EQ(interpreter_->Invoke(), kTfLiteOk); in TestAccumelateLoopBody() [all …]
|
D | if_test.cc | 38 interpreter_->AddSubgraphs(2); in SetUp() 39 builder_->BuildAddSubgraph(interpreter_->subgraph(1)); in SetUp() 40 builder_->BuildMulSubgraph(interpreter_->subgraph(2)); in SetUp() 41 builder_->BuildIfSubgraph(&interpreter_->primary_subgraph()); in SetUp() 43 interpreter_->ResizeInputTensor(interpreter_->inputs()[0], {1}); in SetUp() 44 interpreter_->ResizeInputTensor(interpreter_->inputs()[1], {2}); in SetUp() 45 interpreter_->ResizeInputTensor(interpreter_->inputs()[2], {1, 2}); in SetUp() 46 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in SetUp() 48 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[1]), {5, 7}); in SetUp() 49 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[2]), {1, 2}); in SetUp() [all …]
|
D | while_test.cc | 42 interpreter_.reset(new Interpreter); in TEST_F() 43 interpreter_->AddSubgraphs(2); in TEST_F() 44 builder_->BuildLessEqualCondSubgraph(interpreter_->subgraph(1), i); in TEST_F() 45 builder_->BuildAccumulateLoopBodySubgraph(interpreter_->subgraph(2)); in TEST_F() 46 builder_->BuildWhileSubgraph(&interpreter_->primary_subgraph()); in TEST_F() 48 interpreter_->ResizeInputTensor(interpreter_->inputs()[0], {1}); in TEST_F() 49 interpreter_->ResizeInputTensor(interpreter_->inputs()[1], {1}); in TEST_F() 50 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in TEST_F() 51 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[0]), {1}); in TEST_F() 52 FillIntTensor(interpreter_->tensor(interpreter_->inputs()[1]), {1}); in TEST_F() [all …]
|
D | variable_ops_test.cc | 56 ASSERT_EQ(interpreter_.AddTensors(4, &first_new_tensor_index), kTfLiteOk); in ConstructGraph() 57 ASSERT_EQ(interpreter_.SetInputs({0, 1, 2}), kTfLiteOk); in ConstructGraph() 58 ASSERT_EQ(interpreter_.SetOutputs({3}), kTfLiteOk); in ConstructGraph() 59 interpreter_.SetTensorParametersReadWrite(0, kTfLiteInt32, "", 0, nullptr, in ConstructGraph() 61 interpreter_.SetTensorParametersReadWrite(1, kTfLiteInt32, "", 0, nullptr, in ConstructGraph() 63 interpreter_.SetTensorParametersReadWrite(2, kTfLiteFloat32, "", 0, nullptr, in ConstructGraph() 65 interpreter_.SetTensorParametersReadWrite(3, kTfLiteFloat32, "", 0, nullptr, in ConstructGraph() 68 interpreter_.AddNodeWithParameters({0, 2}, {}, nullptr, 0, nullptr, in ConstructGraph() 70 interpreter_.AddNodeWithParameters({1}, {3}, nullptr, 0, nullptr, in ConstructGraph() 75 Interpreter interpreter_; member in tflite::__anon43f405ca0111::VariableOpsTest [all …]
|
D | test_util.cc | 175 CHECK(InterpreterBuilder(model, *resolver_)(&interpreter_, num_threads) == in BuildInterpreter() 178 CHECK(interpreter_ != nullptr); in BuildInterpreter() 181 const int input_idx = interpreter_->inputs()[i]; in BuildInterpreter() 185 CHECK(interpreter_->ResizeInputTensor(input_idx, shape) == kTfLiteOk); in BuildInterpreter() 188 interpreter_->SetAllowFp16PrecisionForFp32(allow_fp32_relax_to_fp16); in BuildInterpreter() 190 CHECK(interpreter_->AllocateTensors() == kTfLiteOk) in BuildInterpreter() 192 interpreter_->ResetVariableTensors(); in BuildInterpreter() 203 interpreter_->ModifyGraphWithDelegate(TestNnApiDelegate()); in ApplyDelegate() 208 apply_delegate_fn_(interpreter_.get()); in ApplyDelegate() 212 void SingleOpModel::Invoke() { ASSERT_EQ(interpreter_->Invoke(), kTfLiteOk); } in Invoke() [all …]
|
D | subgraph_test_util.h | 93 : interpreter_(new Interpreter), builder_(new SubgraphBuilder) {} in ControlFlowOpTest() 96 interpreter_.reset(); in ~ControlFlowOpTest() 101 std::unique_ptr<Interpreter> interpreter_;
|
D | test_util.h | 209 TfLiteTensor* t = interpreter_->tensor(index); in QuantizeAndPopulate() 229 TfLiteTensor* t = interpreter_->tensor(index); in PerChannelSymmetricQuantizeAndPopulate() 258 TfLiteTensor* t = interpreter_->tensor(index); in PerChannelQuantizeBias() 316 auto tensor = interpreter_->tensor(index); in PopulateStringTensor() 328 T* v = interpreter_->typed_tensor<T>(index); in PopulateTensor() 330 auto* t = interpreter_->tensor(index); in PopulateTensor() 350 T* v = interpreter_->typed_tensor<T>(index); in PopulateTensor() 352 auto* t = interpreter_->tensor(index); in PopulateTensor() 370 T* v = interpreter_->typed_tensor<T>(index); in PopulateTensor() 377 const T* v = interpreter_->typed_tensor<T>(index); in ExtractVector() [all …]
|
/external/tensorflow/tensorflow/lite/profiling/ |
D | profile_summarizer_test.cc | 78 tflite::Interpreter* GetInterpreter() { return interpreter_.get(); } in GetInterpreter() 153 interpreter_->AddSubgraphs(2); in SetUp() 154 builder_->BuildAddSubgraph(interpreter_->subgraph(1)); in SetUp() 155 builder_->BuildMulSubgraph(interpreter_->subgraph(2)); in SetUp() 156 builder_->BuildIfSubgraph(&interpreter_->primary_subgraph()); in SetUp() 158 interpreter_->ResizeInputTensor(interpreter_->inputs()[0], {1}); in SetUp() 159 interpreter_->ResizeInputTensor(interpreter_->inputs()[1], {2}); in SetUp() 160 interpreter_->ResizeInputTensor(interpreter_->inputs()[2], {1, 2}); in SetUp() 161 ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteOk); in SetUp() 164 interpreter_->tensor(interpreter_->inputs()[1]), {5, 7}); in SetUp() [all …]
|
/external/tensorflow/tensorflow/lite/ |
D | interpreter_test.cc | 53 TfLiteContext* GetInterpreterContext() { return interpreter_.context_; } in GetInterpreterContext() 55 Interpreter interpreter_; member in tflite::InterpreterTest 1063 interpreter_.SetNumThreads(4); in TEST_F() 1067 interpreter_.SetNumThreads(4); in TEST_F() 1068 interpreter_.SetNumThreads(5); in TEST_F() 1073 interpreter_.SetNumThreads(4); in TEST_F() 1163 ASSERT_EQ(interpreter_.AddNodeWithParameters( in MakeCopyNode() 1167 ASSERT_EQ(interpreter_.ResizeInputTensor(input, {3}), kTfLiteOk); in MakeCopyNode() 1172 ASSERT_EQ(interpreter_.AddTensors(4), kTfLiteOk); in SetUp() 1173 interpreter_.SetInputs({0, 1}); in SetUp() [all …]
|
/external/tensorflow/tensorflow/lite/delegates/gpu/common/ |
D | model_builder_test.cc | 127 EXPECT_EQ(interpreter_.AddTensors(5), kTfLiteOk); in InterpreterFp16() 128 EXPECT_EQ(interpreter_.SetInputs({0, 1}), kTfLiteOk); in InterpreterFp16() 129 EXPECT_EQ(interpreter_.SetOutputs({4}), kTfLiteOk); in InterpreterFp16() 134 EXPECT_EQ(interpreter_.AddNodeWithParameters( in InterpreterFp16() 143 EXPECT_EQ(interpreter_.AddNodeWithParameters( in InterpreterFp16() 161 EXPECT_EQ(interpreter_.AddNodeWithParameters( in InterpreterFp16() 174 interpreter_.SetTensorParametersReadWrite( in InterpreterFp16() 178 interpreter_.SetTensorParametersReadWrite( in InterpreterFp16() 182 interpreter_.SetTensorParametersReadWrite( in InterpreterFp16() 186 interpreter_.SetTensorParametersReadWrite( in InterpreterFp16() [all …]
|
/external/tensorflow/tensorflow/lite/experimental/kernels/ |
D | hashtable_ops_test.cc | 117 interpreter_ = absl::make_unique<Interpreter>(&error_reporter_); in HashtableGraph() 127 interpreter_->AddNodeWithParameters( in BuildDefaultGraph() 133 interpreter_->AddNodeWithParameters( in BuildDefaultGraph() 138 interpreter_->AddNodeWithParameters( in BuildDefaultGraph() 144 interpreter_->AddNodeWithParameters( in BuildDefaultGraph() 154 interpreter_->AddNodeWithParameters( in BuildNoImportGraph() 160 interpreter_->AddNodeWithParameters( in BuildNoImportGraph() 166 interpreter_->AddNodeWithParameters( in BuildNoImportGraph() 176 interpreter_->AddNodeWithParameters( in BuildImportTwiceGraph() 182 interpreter_->AddNodeWithParameters( in BuildImportTwiceGraph() [all …]
|
/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 if (!interpreter_) { in ApplyCustomDelegate() 68 interpreter_->ModifyGraphWithDelegate(delegates_.back().get())); in ApplyCustomDelegate() 91 InterpreterBuilder(*model_, *resolver_)(&interpreter_); in Init() 92 if (!interpreter_) { in Init() 96 interpreter_->SetNumThreads(params.num_threads()); in Init() 127 if (interpreter_->ModifyGraphWithDelegate(delegates_[i].get()) != in Init() [all …]
|
/external/tensorflow/tensorflow/lite/python/interpreter_wrapper/ |
D | interpreter_wrapper.cc | 47 if (i >= interpreter_->tensors_size() || i < 0) { \ 50 interpreter_->tensors_size()); \ 55 if (i >= interpreter_->nodes_size() || i < 0) { \ 61 if (!interpreter_) { \ 183 interpreter_(std::move(interpreter)) {} in InterpreterWrapper() 189 TFLITE_PY_CHECK(interpreter_->AllocateTensors()); in AllocateTensors() 199 status_code = interpreter_->Invoke(); in Invoke() 210 PyObject* np_array = PyArrayFromIntVector(interpreter_->inputs().data(), in InputIndices() 211 interpreter_->inputs().size()); in InputIndices() 217 PyObject* np_array = PyArrayFromIntVector(interpreter_->outputs().data(), in OutputIndices() [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() 73 interpreter_->AddTensors(num_tensors); in AddTensors() 81 CHECK_EQ(interpreter_->SetTensorParametersReadWrite(i, type, in AddTensors() 87 CHECK_EQ(interpreter_->SetInputs(inputs), kTfLiteOk); in AddTensors() [all …]
|
D | delegate_test.cc | 31 interpreter_.reset(new Interpreter(&error_reporter_)); in DelegateTest() 37 interpreter_.reset(); in ~DelegateTest() 42 ASSERT_EQ(interpreter_->ModifyGraphWithDelegate(delegate_.get()), in ConfigureDelegate() 224 interpreter_.swap(interpreter); in TEST_F() 239 interpreter_.swap(interpreter); in TEST_F() 247 interpreter_.swap(interpreter); in TEST_F() 264 interpreter_->SetNumThreads(1); in TEST_F() 289 interpreter_->SetNumThreads(4); in TEST_F()
|
D | test_util.h | 50 memcpy(interpreter_->typed_tensor<T>(tensor_index), values.data(), in SetTypedValues() 57 const TfLiteTensor* t = interpreter_->tensor(tensor_index); in GetTypedValues() 58 const T* tdata = interpreter_->typed_tensor<T>(tensor_index); in GetTypedValues() 104 std::unique_ptr<Interpreter> interpreter_;
|
/external/tensorflow/tensorflow/lite/tools/benchmark/ |
D | benchmark_tflite_model.cc | 67 : interpreter_(interpreter), profiler_(max_num_entries) { in ProfilingListener() 69 interpreter_->SetProfiler(&profiler_); in ProfilingListener() 87 Interpreter* interpreter_; member in tflite::benchmark::__anon4daa9aad0111::ProfilingListener 110 init_summarizer_.ProcessProfiles(profile_events, *interpreter_); in OnBenchmarkStart() 136 run_summarizer_.ProcessProfiles(profile_events, *interpreter_); in OnSingleRunEnd() 368 TFLITE_BENCHMARK_CHECK(interpreter_); in ComputeInputBytes() 370 for (int input : interpreter_->inputs()) { in ComputeInputBytes() 371 auto* t = interpreter_->tensor(input); in ComputeInputBytes() 384 auto interpreter_inputs = interpreter_->inputs(); in PrepareInputData() 396 TfLiteTensor* t = interpreter_->tensor(i); in PrepareInputData() [all …]
|
/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 …]
|
D | tflite_driver.h | 42 return interpreter_->inputs(); in GetInputs() 45 return interpreter_->outputs(); in GetOutputs() 77 std::unique_ptr<Interpreter> interpreter_; variable
|
/external/tensorflow/tensorflow/lite/experimental/writer/ |
D | writer_lib.cc | 53 operator_to_opcode.resize(interpreter_->nodes_size(), -1); in ExportOperators() 54 for (int op_index : interpreter_->execution_plan()) { in ExportOperators() 56 interpreter_->node_and_registration(op_index); in ExportOperators() 67 for (int op_index : interpreter_->execution_plan()) { in ExportOperators() 69 interpreter_->node_and_registration(op_index); in ExportOperators() 92 custom_writer->second(fbb, interpreter_, op_index, &custom_options, in ExportOperators() 121 tensor_to_written_tensor_.resize(interpreter_->tensors_size(), -1); in ExportTensors() 126 std::vector<bool> tensor_is_temporary(interpreter_->tensors_size(), false); in ExportTensors() 127 for (int op_index = 0; op_index < interpreter_->nodes_size(); ++op_index) { in ExportTensors() 129 interpreter_->node_and_registration(op_index); in ExportTensors() [all …]
|
/external/tensorflow/tensorflow/lite/experimental/delegates/hexagon/builders/tests/ |
D | hexagon_delegate_op_model.h | 59 ASSERT_TRUE(interpreter_ != nullptr); in ApplyDelegateAndInvoke() 61 EXPECT_TRUE(interpreter_->ModifyGraphWithDelegate(delegate_.get()) != in ApplyDelegateAndInvoke() 64 ASSERT_EQ(1, interpreter_->execution_plan().size()); in ApplyDelegateAndInvoke() 65 const int node = interpreter_->execution_plan()[0]; in ApplyDelegateAndInvoke() 66 const auto* node_and_reg = interpreter_->node_and_registration(node); in ApplyDelegateAndInvoke()
|
/external/tensorflow/tensorflow/lite/python/optimize/ |
D | calibration_wrapper.cc | 40 if (!interpreter_) { \ 103 : interpreter_(std::move(interpreter)), in CalibrationWrapper() 114 TFLITE_PY_CHECK(interpreter_->AllocateTensors()); in Prepare() 115 TFLITE_PY_CHECK(interpreter_->ResetVariableTensors()); in Prepare() 129 if (inputs_size != interpreter_->inputs().size()) { in FeedTensor() 132 interpreter_->inputs().size(), inputs_size); in FeedTensor() 141 int input_tensor_idx = interpreter_->inputs()[i]; in FeedTensor() 147 TFLITE_PY_CHECK(interpreter_->Invoke()); in FeedTensor() 163 const TfLiteTensor* tensor = interpreter_->tensor(index); in SetTensor()
|
/external/tensorflow/tensorflow/lite/testing/ |
D | tflite_driver.cc | 357 if (interpreter_->AllocateTensors() != kTfLiteOk) { in AllocateTensors() 374 InterpreterBuilder(*model_, *resolver_)(&interpreter_); in LoadModel() 375 if (!interpreter_) { in LoadModel() 380 if (interpreter_->ModifyGraphWithDelegate(delegate_.get()) != kTfLiteOk) { in LoadModel() 391 auto* tensor = interpreter_->tensor(id); in ResetTensor() 397 if (interpreter_->ResizeInputTensor( in ReshapeTensor() 407 auto* tensor = interpreter_->tensor(id); in SetInput() 475 auto* tensor = interpreter_->tensor(id); in SetExpectation() 532 if (interpreter_->Invoke() != kTfLiteOk) { in Invoke() 542 auto* tensor = interpreter_->tensor(id); in CheckResults() [all …]
|
D | tflite_driver.h | 54 return interpreter_->inputs(); in GetInputs() 57 return interpreter_->outputs(); in GetOutputs() 94 std::unique_ptr<Interpreter> interpreter_; variable
|
/external/tensorflow/tensorflow/lite/testing/kernel_test/ |
D | input_generator.cc | 94 InterpreterBuilder(*model_, builtin_ops)(&interpreter_); in LoadModel() 95 if (!interpreter_) { in LoadModel() 141 auto input_tensor_ids = interpreter_->inputs(); in GenerateInput() 143 auto* tensor = interpreter_->tensor(id); in GenerateInput()
|