MCPcopy Create free account
hub / github.com/CompVis/zigma / log_state

Function log_state

transport/utils.py:18–29  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

16 return th.mean(x, dim=list(range(1, len(x.size()))))
17
18def log_state(state):
19 result = []
20
21 sorted_state = dict(sorted(state.items()))
22 for key, value in sorted_state.items():
23 # Check if the value is an instance of a class
24 if "<object" in str(value) or "object at" in str(value):
25 result.append(f"{key}: [{value.__class__.__name__}]")
26 else:
27 result.append(f"{key}: {value}")
28
29 return '\n'.join(result)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected