in lib/util.py [0:0]
def get_module_log_keys_recursive(m: nn.Module):
"""Recursively get all keys that a module and its children want to log."""
keys = []
if hasattr(m, "get_log_keys"):
keys += m.get_log_keys()
for c in m.children():
keys += get_module_log_keys_recursive(c)
return keys