How to get the type of a Tensor?
You can use get_shape() to get the shape of a tensorflow variable.
>>> x = tf.Variable(tf.random_normal([256, 100]))
>>> x.get_shape()
(256, 100)
You can use dtype property to get the type of a tensorflow variable.
>>> x = tf.Variable(tf.random_normal([256, 100]))
>>> x.dtype
<dtype: 'float32_ref'>
You can use as_numpy_dtype property of dtype to convert from tf.dtype to numpy dtype.
>>> x = tf.Variable(tf.random_normal([256, 100]))
>>> x.dtype.as_numpy_dtype
<class 'numpy.float32'>
To get the type you can do
x.dtype