<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/core/train_utils.py#L71-L87) |

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]

<br />

<br />

<br />

| ## Args ||
|---|---|
| `d` | The dictionary to extract value from. |
| `cast_fn` | The casting function. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A dictionray with the same structure as d. ||

<br />