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

Function Import

tensorflow/lite/toco/toco_tooling.cc:210–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208} // namespace
209
210std::unique_ptr<Model> Import(const TocoFlags& toco_flags,
211 const ModelFlags& model_flags,
212 const string& input_file_contents) {
213 std::unique_ptr<Model> model;
214 switch (toco_flags.input_format()) {
215 case TENSORFLOW_GRAPHDEF: {
216 TensorFlowImportFlags tf_import_flags;
217 tf_import_flags.drop_control_dependency =
218 toco_flags.has_drop_control_dependency()
219 ? toco_flags.drop_control_dependency()
220 : (toco_flags.output_format() != TENSORFLOW_GRAPHDEF);
221
222 tf_import_flags.import_all_ops_as_unsupported =
223 toco_flags.force_select_tf_ops();
224
225 model = ImportTensorFlowGraphDef(model_flags, tf_import_flags,
226 input_file_contents);
227 break;
228 }
229 case TFLITE:
230 model = toco::tflite::Import(model_flags, input_file_contents);
231 ResolveModelFlags(model_flags, model.get());
232 CheckInvariants(*model);
233 break;
234 default:
235 LOG(FATAL) << "Unhandled input_format='"
236 << FileFormat_Name(toco_flags.input_format()) << "'";
237 }
238
239 LogDump(kLogLevelModelChanged, "AT IMPORT", *model);
240
241 return model;
242}
243
244tensorflow::Status TransformWithStatus(const TocoFlags& toco_flags,
245 Model* model) {

Callers 1

ConvertFunction · 0.70

Calls 5

ImportTensorFlowGraphDefFunction · 0.85
ResolveModelFlagsFunction · 0.85
CheckInvariantsFunction · 0.85
LogDumpFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected