MCPcopy
hub / github.com/xai-org/grok-1 / path_tuple_to_string

Function path_tuple_to_string

checkpoint.py:110–119  ·  view source on GitHub ↗
(path: tuple)

Source from the content-addressed store, hash-verified

108
109
110def path_tuple_to_string(path: tuple) -> str:
111 pieces = []
112 for elem in path:
113 if isinstance(elem, jax.tree_util.DictKey):
114 pieces.append(elem.key)
115 elif isinstance(elem, jax.tree_util.GetAttrKey):
116 pieces.append(elem.name)
117 else:
118 assert isinstance(elem, (jax.tree_util.FlattenedIndexKey, jax.tree_util.SequenceKey))
119 return "/".join(pieces)
120
121
122def get_load_path_str(

Callers 1

replace_with_load_stateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected