Cast a Tensor to another Type in TensorFlow

We can cast a Tensor to another type in tensorflow as below: Cast a Tensor to another Type in TensorFlow Code as below: import tensorflow as tf # Create a TensorFlow float type Tensor x x = tf.constant([1.8, 2.2], dtype=tf.float32) # Cast a Tensor of float type to int Type in TensorFlow x = tf.dtypes.cast(x, … Continue reading Cast a Tensor to another Type in TensorFlow