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

Function GetAllocationFromFile

tensorflow/lite/model.cc:65–76  ·  view source on GitHub ↗

Loads a model from `filename`. If `mmap_file` is true then use mmap, otherwise make a copy of the model in a buffer.

Source from the content-addressed store, hash-verified

63// Loads a model from `filename`. If `mmap_file` is true then use mmap,
64// otherwise make a copy of the model in a buffer.
65std::unique_ptr<Allocation> GetAllocationFromFile(const char* filename,
66 bool mmap_file,
67 ErrorReporter* error_reporter,
68 bool use_nnapi) {
69 std::unique_ptr<Allocation> allocation;
70 if (mmap_file && MMAPAllocation::IsSupported()) {
71 allocation.reset(new MMAPAllocation(filename, error_reporter));
72 } else {
73 allocation.reset(new FileCopyAllocation(filename, error_reporter));
74 }
75 return allocation;
76}
77
78std::unique_ptr<FlatBufferModel> FlatBufferModel::BuildFromFile(
79 const char* filename, ErrorReporter* error_reporter) {

Callers 2

BuildFromFileMethod · 0.85

Calls 2

IsSupportedFunction · 0.50
resetMethod · 0.45

Tested by

no test coverage detected