# tf.graph_util.extract_sub_graph

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/framework/graph_util_impl.py#L172-L210) |

Extract the subgraph that can reach any of the nodes in 'dest_nodes'. (deprecated)

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.graph_util.extract_sub_graph`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/graph_util/extract_sub_graph)

<br />

    tf.graph_util.extract_sub_graph(
        graph_def, dest_nodes
    )

> [!WARNING]
> **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.compat.v1.graph_util.extract_sub_graph`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/graph_util/extract_sub_graph)

<br />

<br />

<br />

| ## Args ||
|---|---|
| `graph_def` | A graph_pb2.GraphDef proto. |
| `dest_nodes` | A list of strings specifying the destination node names. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The GraphDef of the sub-graph. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | If 'graph_def' is not a graph_pb2.GraphDef proto. |

<br />