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

Function FlatBufferIntArrayToVector

tensorflow/lite/model.cc:273–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271namespace {
272template <class T>
273std::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.
287class MallocDataAllocator : public BuiltinDataAllocator {

Callers 3

ParseNodesMethod · 0.85
ParseTensorsMethod · 0.85
operator()Method · 0.85

Calls 2

LengthMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected