Reputation: 103
Can someone explain to me why does this example have a shape of [2,1,3], i just don't see it?
[[[1., 2., 3.]], [[7., 8., 9.]]] # a rank 3 tensor with shape [2, 1, 3]
Upvotes: 2
Views: 328
Reputation: 19143
Indentation does wonders:
[ # this one contains 2 items
[ # each of this contains 1 item
[1., 2., 3.] # each of this contains 3 items
],
[
[7., 8., 9.]
]
]
Thus, shape is [2,1,3]
Upvotes: 5