一个例子,源自https://www.jianshu.com/p/f34457c222c5该博客,慢慢体会,印象最深!
#三维张量,3行4列深度为2的张量
const3 = tf.constant([
[[ 1, 2], [ 3, 4], [ 5, 6], [ 7, 8]],
[[11, 12], [13, 14], [15, 16], [17, 18]],
[[21, 22], [23, 24], [25, 26], [27, 28]]
], tf.float16)
print(const3)
程序运行结果:
Tensor("Const_3:0", shape=(3, 4, 2), dtype=float16)
可视化表示:
以上内容。如有错误,敬请批评指正!谢谢!