View source on GitHub |
Cast the leaves of a dictionary with arbitrary depth in place.
tfm.core.train_utils.cast_leaf_nested_dict(
d: Dict[str, Any], cast_fn: Callable[[Any], Any]
) -> Dict[str, Any]
Args | |
---|---|
d
|
The dictionary to extract value from. |
cast_fn
|
The casting function. |
Returns | |
---|---|
A dictionray with the same structure as d. |