#79618·Paddle

paddle.i0 prematurely overflows to Inf for finite float64 result

Author: ALinrunrunCreated Aug 6, 2026Updated Aug 17, 2026
Labelsstatus/new-issuetype/bug-report

bug描述 Describe the Bug

paddle.i0 prematurely overflows to Inf for a finite float64 input.

For input 713.0, the modified Bessel function i0(713.0) is approximately 6.705128263670996e+307, which is finite and still within the float64 range. However, Paddle returns Inf.

Environment

  • PaddlePaddle version: 3.3.1
  • NumPy version: 2.2.6
  • dtype: float64
  • Device: CPU

Minimal reproducible code

python
import numpy as np
import paddle

x = paddle.to_tensor(
    np.asarray([713.0], dtype=np.float64)
)

wrong = paddle.i0(x).numpy()

expected = np.asarray(
    [6.705128263670996e+307],
    dtype=np.float64,
)

print("wrong:", wrong.tolist())
print("expected:", expected.tolist())

Actual behavior

bash
wrong: [inf]

Expected behavior

bash
expected: [6.705128263670996e+307]

paddle.i0(713.0) should return a finite float64 value close to 6.705128263670996e+307.

Instead, Paddle prematurely overflows the result to Inf.

其他补充信息 Additional Supplementary Information

No response