| 271 | namespace { |
| 272 | template <class T> |
| 273 | std::vector<int> FlatBufferIntArrayToVector(T* flat_array) { |
| 274 | // Initialize shape of tensors with null shape. Empty vectors are converted |
| 275 | // to nullptr for models that are constructed via flatbuffers::Pack. |
| 276 | if (flat_array == nullptr) { |
| 277 | return {}; |
| 278 | } |
| 279 | std::vector<int> ret(flat_array->Length()); |
| 280 | for (int i = 0; i < flat_array->Length(); i++) { |
| 281 | ret[i] = flat_array->Get(i); |
| 282 | } |
| 283 | return ret; |
| 284 | } |
| 285 | |
| 286 | // Used to determine how the op data parsing function creates its working space. |
| 287 | class MallocDataAllocator : public BuiltinDataAllocator { |
no test coverage detected