| 57 | } |
| 58 | |
| 59 | void CopyStringFromBuffer(const ::tflite::Buffer& buffer, Array* array) { |
| 60 | auto* src_data = reinterpret_cast<const char*>(buffer.data()->data()); |
| 61 | std::vector<string>* dst_data = |
| 62 | &array->GetMutableBuffer<ArrayDataType::kString>().data; |
| 63 | int32_t num_strings = ::tflite::GetStringCount(src_data); |
| 64 | for (int i = 0; i < num_strings; i++) { |
| 65 | ::tflite::StringRef str_ref = ::tflite::GetString(src_data, i); |
| 66 | string this_str(str_ref.str, str_ref.len); |
| 67 | dst_data->push_back(this_str); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | template <ArrayDataType T> |
| 72 | void CopyBuffer(const ::tflite::Buffer& buffer, Array* array) { |
no test coverage detected