# PyTorch 写法 (rounding_mode 参数设置为 None)
x = torch.div(torch.tensor([2, 3, 4]), torch.tensor([1, 5, 2]))
# Paddle 写法
a = paddle.to_tensor([2, 3, 4], dtype='float64')
b = paddle.to_tensor([1, 5, 2], dtype='float64')
x = paddle.divide(a, b)
# PyTorch 写法 (rounding_mode 参数设置为"trunc")
x = torch.div(torch.tensor([-0.3711, -1.9353]), torch.tensor([0.8032, 0.2930]), rounding_mode='trunc')
# Paddle 写法
x = paddle.divide(paddle.to_tensor([-0.3711, -1.9353]), paddle.to_tensor([0.8032, 0.2930]))
x = paddle.trunc(x)
# PyTorch 写法 (rounding_mode 参数设置为"floor")
x = torch.div(torch.tensor([-0.3711, -1.9353]), torch.tensor([0.8032, 0.2930]), rounding_mode='floor')
# Paddle 写法
x = paddle.divide(paddle.to_tensor([-0.3711, -1.9353]), paddle.to_tensor([0.8032, 0.2930]))
x = paddle.floor(x)