torch.max(*args, **kwargs)
paddle.compat.max(*args, **kwargs)
torch.max 有多种签名与用法,均只需修改 torch 前缀为 paddle.compat,具体如下:
# PyTorch 写法 result = torch.max(x) # Paddle 写法 result = paddle.compat.max(x)