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

Function _parse_input_graph_proto

tensorflow/python/tools/freeze_graph.py:243–254  ·  view source on GitHub ↗

Parses input tensorflow graph into GraphDef proto.

(input_graph, input_binary)

Source from the content-addressed store, hash-verified

241
242
243def _parse_input_graph_proto(input_graph, input_binary):
244 """Parses input tensorflow graph into GraphDef proto."""
245 if not gfile.Exists(input_graph):
246 raise IOError("Input graph file '" + input_graph + "' does not exist!")
247 input_graph_def = graph_pb2.GraphDef()
248 mode = "rb" if input_binary else "r"
249 with gfile.GFile(input_graph, mode) as f:
250 if input_binary:
251 input_graph_def.ParseFromString(f.read())
252 else:
253 text_format.Merge(f.read(), input_graph_def)
254 return input_graph_def
255
256
257def _parse_input_meta_graph_proto(input_graph, input_binary):

Callers 1

freeze_graphFunction · 0.85

Calls 5

IOErrorFunction · 0.85
ExistsMethod · 0.45
ParseFromStringMethod · 0.45
readMethod · 0.45
MergeMethod · 0.45

Tested by

no test coverage detected