[[[1.,2.,3.]],[[7.,8.,9.]]]#形状为[2,1,3]的3级张量

Blu*_*ude 2 tensorflow

有人可以向我解释为什么这个示例的形状为[2,1,3],但我看不到吗?

[[[1.,2.,3.]],[[7.,8.,9.]]]#形状为[2,1,3]的3级张量

GPh*_*ilo 5

缩进确实令人惊奇:

[ # this one contains 2 items
    [ # each of this contains 1 item
        [1., 2., 3.] # each of this contains 3 items
    ], 
    [
        [7., 8., 9.]
    ]
]
Run Code Online (Sandbox Code Playgroud)

因此,形状是 [2,1,3]