You can use get_shape () to get the form of the tensorflow variable.
>>> x = tf.Variable(tf.random_normal([256, 100]))
>>> x.get_shape()
(256, 100)
You can use the dtype property to get the type of the tensorflow variable.
>>> x = tf.Variable(tf.random_normal([256, 100]))
>>> x.dtype
<dtype: 'float32_ref'>
You can use the as_numpy_dtype dtype property to convert from tf.dtype to numpy dtype .
>>> x = tf.Variable(tf.random_normal([256, 100]))
>>> x.dtype.as_numpy_dtype
<class 'numpy.float32'>
source
share