pytorch中的size()和shape()的使用

示例:

import torch
from torch import tensor
a = torch.tensor([[[0,1,2,3],[10,11,12,13]],[[20,21,22,23],[30,31,32,33]]])
print(a.shape)
print(a.size())

在这里插入图片描述

更多推荐