umu*_*tto 24
您可以使用get_shape()来获取tensorflow变量的形状.
>>> x = tf.Variable(tf.random_normal([256, 100]))
>>> x.get_shape()
(256, 100)
Run Code Online (Sandbox Code Playgroud)
您可以使用dtype属性来获取tensorflow变量的类型.
>>> x = tf.Variable(tf.random_normal([256, 100]))
>>> x.dtype
<dtype: 'float32_ref'>
Run Code Online (Sandbox Code Playgroud)
您可以使用dtype的as_numpy_dtype属性将tf.dtype转换为numpy dtype.
>>> x = tf.Variable(tf.random_normal([256, 100]))
>>> x.dtype.as_numpy_dtype
<class 'numpy.float32'>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18788 次 |
| 最近记录: |