| 37 | |
| 38 | template <typename T> |
| 39 | int FillTensorWithData(tensorflow::Tensor* tensor, |
| 40 | const string& values_as_string) { |
| 41 | const auto& values = testing::Split<T>(values_as_string, ","); |
| 42 | |
| 43 | if (values.size() == tensor->NumElements()) { |
| 44 | auto data = tensor->flat<T>(); |
| 45 | for (int i = 0; i < values.size(); i++) { |
| 46 | data(i) = values[i]; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | return values.size(); |
| 51 | } |
| 52 | |
| 53 | // Assumes 'values_as_string' is a hex string that gets converted into a |
| 54 | // TF Lite DynamicBuffer. Strings are then extracted and copied into the |
nothing calls this directly
no test coverage detected