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

Function list_variables

tensorflow/python/training/checkpoint_utils.py:91–106  ·  view source on GitHub ↗

Returns list of all variables in the checkpoint. Args: ckpt_dir_or_file: Directory with checkpoints file or path to checkpoint. Returns: List of tuples `(name, shape)`.

(ckpt_dir_or_file)

Source from the content-addressed store, hash-verified

89
90@tf_export("train.list_variables")
91def list_variables(ckpt_dir_or_file):
92 """Returns list of all variables in the checkpoint.
93
94 Args:
95 ckpt_dir_or_file: Directory with checkpoints file or path to checkpoint.
96
97 Returns:
98 List of tuples `(name, shape)`.
99 """
100 reader = load_checkpoint(ckpt_dir_or_file)
101 variable_map = reader.get_variable_to_shape_map()
102 names = sorted(variable_map.keys())
103 result = []
104 for name in names:
105 result.append((name, variable_map[name]))
106 return result
107
108
109def wait_for_new_checkpoint(checkpoint_dir,

Callers

nothing calls this directly

Calls 3

load_checkpointFunction · 0.70
keysMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected