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

Method LoadModel

tensorflow/lite/testing/kernel_test/input_generator.cc:86–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84} // namespace
85
86TfLiteStatus InputGenerator::LoadModel(const string& model_dir) {
87 model_ = FlatBufferModel::BuildFromFile(model_dir.c_str());
88 if (!model_) {
89 fprintf(stderr, "Cannot load model %s", model_dir.c_str());
90 return kTfLiteError;
91 }
92
93 ::tflite::ops::builtin::BuiltinOpResolver builtin_ops;
94 InterpreterBuilder(*model_, builtin_ops)(&interpreter_);
95 if (!interpreter_) {
96 fprintf(stderr, "Failed to build interpreter.");
97 return kTfLiteError;
98 }
99
100 return kTfLiteOk;
101}
102
103TfLiteStatus InputGenerator::ReadInputsFromFile(const string& filename) {
104 if (filename.empty()) {

Callers 2

TESTFunction · 0.45
RunKernelTestFunction · 0.45

Calls 2

InterpreterBuilderClass · 0.85
c_strMethod · 0.80

Tested by 1

TESTFunction · 0.36