Python get pytorch tensor size
I wanna know how to get the shape of this tensor in Python ? I have tried this :

&gt; len(x)


But this prints 1, why ? I want to print the number of tuples here which is 3. Using len(x) prints only 1.

What's the problem ?

Here's the tensor :

 (x=array([[[[ 0.07499999,  0.        ],
         [ 0.0703125 ,  0.        ],
         [ 0.0703125 ,  0.        ],
         [ 0.09218752,  0.        ],
         [ 0.1953125 ,  0.        ],
         [ 0.05312502,  0.        ],
         [ 0.2890625 ,  0.        ],
         [ 0.015625  ,  0.        ],
         [ 0.32656252,  0.        ],
         [ 0.09218752,  0.        ],
         [ 0.23906249,  0.        ],
         [ 0.09218752,  0.        ],
         [ 0.22812498,  0.        ],
         [ 0.06406248,  0.        ],
         [ 0.19062501,  0.        ],
         [ 0.02031249,  0.        ],
         [ 0.17343748,  0.        ]],

        [[ 0.06875002,  0.        ],
         [ 0.06875002,  0.        ],
         [ 0.06875002,  0.        ],
         [ 0.09062499,  0.        ],
         [ 0.19375002,  0.        ],
         [ 0.05781251,  0.        ],
         [ 0.2921875 ,  0.        ],
         [ 0.01406252,  0.        ],
         [ 0.325     ,  0.        ],
         [ 0.08437502,  0.        ],
         [ 0.23124999,  0.        ],
         [ 0.09531248,  0.        ],
         [ 0.22031248,  0.        ],
         [ 0.06406248,  0.        ],
         [ 0.18906248,  0.        ],
         [ 0.02031249,  0.        ],
         [ 0.171875  ,  0.        ]],

        [[ 0.06718749,  0.        ],
         [ 0.06093752,  0.        ],
         [ 0.07187498,  0.        ],
         [ 0.078125  ,  0.        ],
         [ 0.18593752,  0.        ],
         [ 0.03437501,  0.        ],
         [ 0.2765625 ,  0.        ],
         [-0.00312501,  0.        ],
         [ 0.29843748,  0.        ],
         [ 0.078125  ,  0.        ],
         [ 0.21718752,  0.        ],
         [ 0.078125  ,  0.        ],
         [ 0.21249998,  0.        ],
         [ 0.07187498,  0.        ],
         [ 0.19062501,  0.        ],
         [ 0.13749999,  0.        ],
         [ 0.1796875 ,  0.        ]]]], dtype=float32), 0)


It looks like your 3 tuples are located within the first (and only) index of x. In this case, len(x[0]) yields 3.
