# tf.is_tensor

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/is_tensor) | [![](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/tensor_util.py#L934-L949) |

Checks whether `x` is a tensor or "tensor-like".

#### View aliases


**Main aliases**

\`tf.contrib.framework.is_tensor\`
**Compat aliases for migration**

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

[`tf.compat.v1.is_tensor`](https://www.tensorflow.org/api_docs/python/tf/is_tensor), \`tf.compat.v2.is_tensor\`

<br />

    tf.is_tensor(
        x
    )

If `is_tensor(x)` returns `True`, it is safe to assume that `x` is a tensor or
can be converted to a tensor using `ops.convert_to_tensor(x)`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | A python object to check. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `True` if `x` is a tensor or "tensor-like", `False` if not. ||

<br />