how to get data type of a tensor in tensorflow?
You can get the type using x.dtype
, as follows:
import tensorflow as tf
x=tf.constant([1,2])
x.dtype
This prints tf.int32
You can get the type using x.dtype
, as follows:
import tensorflow as tf
x=tf.constant([1,2])
x.dtype
This prints tf.int32