Returns whether x is a Keras tensor.

A "Keras tensor" is a tensor that was returned by a Keras layer, (Layer class) or by Input.

x A candidate tensor.

A boolean: Whether the argument is a Keras tensor.

ValueError In case x is not a symbolic tensor.


np_var = np.array([1, 2])
# A numpy array is not a symbolic tensor.
Traceback (most recent call last):

ValueError: Unexpectedly found an instance of type `<class 'numpy.ndarray'>`.
Expected a symbolic tensor instance.