# tf.contrib.graph_editor.get_tensors

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/graph_editor/util.py#L257-L272) |

get all the tensors which are input or output of an op in the graph.

    tf.contrib.graph_editor.get_tensors(
        graph
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `graph` | a [`tf.Graph`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Graph). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A list of [`tf.Tensor`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Tensor). ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | if graph is not a [`tf.Graph`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Graph). |

<br />