def read_tf_checkpoint(path):
from tensorflow.python import pywrap_tensorflow<EOL>tensors = {}<EOL>reader = pywrap_tensorflow.NewCheckpointReader(path)<EOL>var_to_shape_map = reader.get_variable_to_shape_map()<EOL>for key in sorted(var_to_shape_map):<EOL><INDENT>tensor = reader.get_tensor(key)<EOL>tensors[key] = tensor<EOL><DEDENT>return tensors<EOL>
read tensorflow checkpoint