# tf.is_tensor

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/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/v2.1.0/tensorflow/python/framework/tensor_util.py#L964-L979) |

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

#### View aliases


**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)

<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 />