# tf.contrib.graph_editor.select_ts

<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/select.py#L682-L745) |

Helper to select tensors.

    tf.contrib.graph_editor.select_ts(
        *args, **kwargs
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `*args` | list of 1) regular expressions (compiled or not) or 2) (array of) [`tf.Tensor`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Tensor). [`tf.Operation`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Operation) instances are silently ignored. |
| `**kwargs` | 'graph': [`tf.Graph`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Graph) in which to perform the regex query.This is required when using regex. 'positive_filter': an elem if selected only if `positive_filter(elem)` is `True`. This is optional. 'restrict_ts_regex': a regular expression is ignored if it doesn't start with the substring "(?#ts)". |

<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 the optional keyword argument graph is not a [`tf.Graph`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Graph) or if an argument in args is not an (array of) [`tf.Tensor`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Tensor) or an (array of) [`tf.Operation`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Operation) (silently ignored) or a string or a regular expression. |
| `ValueError` | if one of the keyword arguments is unexpected or if a regular expression is used without passing a graph as a keyword argument. |

<br />