View source on GitHub |
Get leaf from a dictionary with arbitrary depth with a list of keys.
tfm.core.train_utils.get_leaf_nested_dict(
d: Dict[str, Any], keys: List[str]
) -> Dict[str, Any]
Args | |
---|---|
d
|
The dictionary to extract value from. |
keys
|
The list of keys to extract values recursively. |
Returns | |
---|---|
The value of the leaf. |
Raises | |
---|---|
KeyError
|
If the value of keys extracted is a dictionary. |