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

Function _save

tools/low_precision_optimize/low_precision_optimize.py:592–599  ·  view source on GitHub ↗
(save_path)

Source from the content-addressed store, hash-verified

590 return tf.graph_util.extract_sub_graph(graph_def, outputs)
591
592 def _save(save_path):
593 sub_graph_def = _extract_sub_graph(model_inputs + model_outputs)
594 node_names = [node.name for node in sub_graph_def.node]
595 variables = [v for v in get_all_variables() if _nd(v.name) in node_names]
596 init_name = tf.variables_initializer(variables).name
597 saver = tf.train.Saver(variables, sharded=True, allow_empty=True)
598 saver.save(sess, save_path, write_meta_graph=False, write_state=False)
599 return saver, init_name
600
601 # Create Saver
602 tmp_path = tempfile.mkdtemp(dir='.')

Callers 1

optimizeFunction · 0.70

Calls 4

saveMethod · 0.95
_extract_sub_graphFunction · 0.85
get_all_variablesFunction · 0.85
_ndFunction · 0.85

Tested by

no test coverage detected