tf.is_tensor | TensorFlow Core v2.7.0
www.tensorflow.org › api_docs › pythonNov 05, 2021 · For example, in the following code block: if not tf.is_tensor (t): t = tf.convert_to_tensor (t) return t.shape, t.dtype. we check to make sure that t is a tensor (and convert it if not) before accessing its shape and dtype. (But note that not all TensorFlow native types have shapes or dtypes; tf.data.Dataset is an example of a TensorFlow native ...