| 225 | |
| 226 | template <> |
| 227 | std::vector<string> SingleOpModel::ExtractVector(int index) const { |
| 228 | TfLiteTensor* tensor_ptr = interpreter_->tensor(index); |
| 229 | CHECK(tensor_ptr != nullptr); |
| 230 | const int num_strings = GetStringCount(tensor_ptr); |
| 231 | std::vector<string> result; |
| 232 | result.reserve(num_strings); |
| 233 | for (int i = 0; i < num_strings; ++i) { |
| 234 | const auto str = GetString(tensor_ptr, i); |
| 235 | result.emplace_back(str.str, str.len); |
| 236 | } |
| 237 | return result; |
| 238 | } |
| 239 | } // namespace tflite |
nothing calls this directly
no test coverage detected