# core.detach_leaves

``` python
core.detach_leaves(tree)
```

Detach every tensor leaf of a pytree.

## Parameters

| Name | Type | Description                 | Default    |
|------|------|-----------------------------|------------|
| tree | P    | A posterior, or any pytree. | *required* |

## Returns

| Name | Type | Description |
|----|----|----|
|  | P | The tree with every tensor leaf detached, so changes to it never reach the caller’s autograd graph. |
