Copy a std::vector to an existing TfLiteIntArray. This is a low-level data manipulation function, and it's caller's responsibility to ensure TfLiteIntArray has enough size.
| 228 | // This is a low-level data manipulation function, and it's caller's |
| 229 | // responsibility to ensure TfLiteIntArray has enough size. |
| 230 | void CopyVectorToTfLiteIntArray(const std::vector<int>& vec, |
| 231 | TfLiteIntArray* arr) { |
| 232 | arr->size = vec.size(); |
| 233 | memcpy(arr->data, vec.data(), sizeof(int) * arr->size); |
| 234 | } |
| 235 | |
| 236 | // This function allocates a continuous memory space that contains a |
| 237 | // TfLiteDelegateParams followed by a several TfLiteIntArray. |
no test coverage detected