Pytorch data and change the label shape

1: out: torch.Size([128, 5]) torch.Size([128, 1, 5])

2: label.view using () transformation

    print("out:",out.shape,label.shape)
    label = label.view(out.shape[0], out.shape[1])
    print(label.shape)
     

 

Published 234 original articles · won praise 61 · views 120 000 +

Guess you like

Origin blog.csdn.net/weixin_42528089/article/details/103942150
Recommended