| 68 | } |
| 69 | |
| 70 | void FlexModelTest::AddTensors(int num_tensors, const std::vector<int>& inputs, |
| 71 | const std::vector<int>& outputs, TfLiteType type, |
| 72 | const std::vector<int>& dims) { |
| 73 | interpreter_->AddTensors(num_tensors); |
| 74 | for (int i = 0; i < num_tensors; ++i) { |
| 75 | TfLiteQuantizationParams quant; |
| 76 | // Suppress explicit output type specification to ensure type inference |
| 77 | // works properly. |
| 78 | if (std::find(outputs.begin(), outputs.end(), i) != outputs.end()) { |
| 79 | type = kTfLiteFloat32; |
| 80 | } |
| 81 | CHECK_EQ(interpreter_->SetTensorParametersReadWrite(i, type, |
| 82 | /*name=*/"", |
| 83 | /*dims=*/dims, quant), |
| 84 | kTfLiteOk); |
| 85 | } |
| 86 | |
| 87 | CHECK_EQ(interpreter_->SetInputs(inputs), kTfLiteOk); |
| 88 | CHECK_EQ(interpreter_->SetOutputs(outputs), kTfLiteOk); |
| 89 | } |
| 90 | |
| 91 | void FlexModelTest::AddTfLiteMulOp(const std::vector<int>& inputs, |
| 92 | const std::vector<int>& outputs) { |
no test coverage detected