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

Function ReadInputData

tensorflow/lite/toco/toco_convert.cc:55–71  ·  view source on GitHub ↗

Reads the contents of the GraphDef from either the frozen graph file or the SavedModel directory. If it reads the SavedModel directory, it updates the ModelFlags and TocoFlags accordingly.

Source from the content-addressed store, hash-verified

53// SavedModel directory. If it reads the SavedModel directory, it updates the
54// ModelFlags and TocoFlags accordingly.
55void ReadInputData(const ParsedTocoFlags& parsed_toco_flags,
56 const ParsedModelFlags& parsed_model_flags,
57 TocoFlags* toco_flags, ModelFlags* model_flags,
58 string* graph_def_contents) {
59 port::CheckInitGoogleIsDone("InitGoogle is not done yet.\n");
60
61 // Ensure savedmodel_directory is not set.
62 QCHECK(!parsed_toco_flags.savedmodel_directory.specified())
63 << "Use `tensorflow/lite/python/tflite_convert` script with "
64 << "SavedModel directories.\n";
65
66 // Checks the input file permissions and reads the contents.
67 CheckFrozenModelPermissions(parsed_toco_flags.input_file);
68 CHECK(port::file::GetContents(parsed_toco_flags.input_file.value(),
69 graph_def_contents, port::file::Defaults())
70 .ok());
71}
72} // namespace
73
74tensorflow::Status Convert(const string& graph_def_contents,

Callers 1

ConvertFunction · 0.85

Calls 7

CheckInitGoogleIsDoneFunction · 0.85
GetContentsFunction · 0.85
DefaultsFunction · 0.85
specifiedMethod · 0.45
okMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected