[torch 参数更多 ]torch.numel

torch.numel

torch.numel(input)

paddle.Tensor.size

paddle.Tensor.size

其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下:

参数映射

| PyTorch | PaddlePaddle | 备注 | | ————- | ———— | —————————————————— | | input | - | 输入的 Tensor,需要进行转写。 |

转写示例

# Pytorch 写法
torch.numel(a)

# Paddle 写法
a.size