MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ExtractVector

Method ExtractVector

tensorflow/lite/kernels/test_util.cc:227–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225
226template <>
227std::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

Callers

nothing calls this directly

Calls 5

GetStringCountFunction · 0.85
GetStringFunction · 0.85
tensorMethod · 0.45
reserveMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected