[Python] Understanding PyTorch Tensor Shape

Discussão em 'Python' iniciado por Stack, Março 25, 2025.

  1. Stack

    Stack Membro Participativo

    I have a simple question regarding the shape of tensor we define in PyTorch. Let's say if I say:

    input = torch.randn(32, 35)


    This will create a matrix with 32 row and 35 columns. Now when I define:

    input2 = torch.randn(1,2,32, 35)


    What can I say about the dimension of the new matrix input2? How can I define the rows and columns here? I mean do I have two matrices with shapes 32*35 packed by the tensor?

    I want to better understand the geometry behind this. Thanks.

    Continue reading...

Compartilhe esta Página