赞
踩
Numpy | Tensor | |
---|---|---|
a.size | \ | 矩阵元素数量 |
a.shape | a.shape | 形状大小 |
Numpy | Tensor | |
---|---|---|
np.expand_dims(a, axis=1) | a.unsqueeze(1) | 升维 |
np.squeeze(a) | a.squeeze() | 降维 |
np.concatenate((a,b),axis=1) | torch.cat((a,b),dim=1) | 拼接 |
np. tile(a,2) | torch.repeat(2) | 扩展 |
a.repeat(3,2) | \ | 分别复制 |
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。