美文网首页
tensorflow数组表示

tensorflow数组表示

作者: 我是谁的小超人 | 来源:发表于2017-10-19 10:26 被阅读0次

[batch, in_height, in_width, in_channels]

通道1



通道2


表示代码:

a = tf.constant([[
            [[1., 17.],
             [2., 18.], 
             [3., 19.],
             [4., 20.]],
            [[5., 21.],
             [6., 22.],
             [7., 23.],
             [8., 24.]],
            [[9., 25.],
             [10., 26.],
             [11., 27.],
             [12., 28.]],
            [[13., 29.],
             [14., 30.],
             [15., 31.],
             [16., 32.]]
        ]])
a_shape = a.get_shape()
with tf.Session() as sess:
    print(a_shape)
    print('\n')
    print(sess.run(a))

(1, 4, 4, 2)

[[[[ 1. 17.]
[ 2. 18.]
[ 3. 19.]
[ 4. 20.]]

[[ 5. 21.]
[ 6. 22.]
[ 7. 23.]
[ 8. 24.]]

[[ 9. 25.]
[ 10. 26.]
[ 11. 27.]
[ 12. 28.]]

[[ 13. 29.]
[ 14. 30.]
[ 15. 31.]
[ 16. 32.]]]]

相关文章

网友评论

      本文标题:tensorflow数组表示

      本文链接:https://www.haomeiwen.com/subject/wpfuuxtx.html