[ 仅 API 调用方式不一致 ]torch.max

torch.max

torch.max(*args, **kwargs)

paddle.compat.max

paddle.compat.max(*args, **kwargs)

torch.max 有多种签名与用法,均只需修改 torch 前缀为 paddle.compat,具体如下:

转写示例

# PyTorch 写法
result = torch.max(x)

# Paddle 写法
result = paddle.compat.max(x)