Skip to content

Pytorch fundamentals: "Why is this not a tensor?" #959

Answered by matrx2000
kkdotpy asked this question in Q&A
Discussion options

You must be logged in to vote

Tensors need to have consistent dimensions at each level of nesting. In the provided list structure, all sub-lists at the same level must have the same number of elements. In your example:

[
    [
        [
            [
                [
                    [1,1],[1,1]
                ],
                [
                    [1,1],[1] #<-- error is here
                ],
                [
                    [1,1],[1,1]
                ],
                [
                    [1,1],[2,2]
                ]
            ]
        ]
    ]
]

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kkdotpy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants