[Python] Pytorch tensor to numpy array

Discussão em 'Python' iniciado por Stack, Fevereiro 3, 2025.

  1. Stack

    Stack Membro Participativo

    I have a pytorch Tensor of shape [4, 3, 966, 1296]. I want to convert it to numpy array using the following code:

    imgs = imgs.numpy()[:, ::-1, :, :]


    How does that code work?

    Continue reading...

Compartilhe esta Página