Bluffton Python Dude
Bluffton Python Dude

Reputation: 103

[[[1., 2., 3.]], [[7., 8., 9.]]] # a rank 3 tensor with shape [2, 1, 3]

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

Answers (1)

GPhilo
GPhilo

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

Related Questions