Keras 3 API documentation / Utilities / Tensor utilities

Tensor utilities


get_source_inputs function


Returns the list of input tensors necessary to compute tensor.

Output will always be a list of tensors (potentially with 1 element).


  • tensor: The tensor to start from.


List of input tensors.


is_keras_tensor function


Returns whether x is a Keras tensor.

A "Keras tensor" is a symbolic tensor, such as a tensor that was created via Input(). A "symbolic tensor" can be understood as a placeholder – it does not contain any actual numerical data, only a shape and dtype. It can be used for building Functional models, but it cannot be used in actual computations.