[torch 参数更多]torch.Tensor.short

torch.Tensor.short

torch.Tensor.short(memory_format=torch.preserve_format)

paddle.Tensor.astype

paddle.Tensor.astype('int16')

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

参数映射

| PyTorch | PaddlePaddle | 备注 | | ——- | ——- | ——- | | memory_format | - |表示内存格式,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 |