← 返回函数库
常数

pi

π ≈ 3.14159265

圆周率。

Python 实现

下面是教学用的最小实现,目的是让你看懂原理。生产中请用 PyTorch / TensorFlow 的高性能 op。

python

同类函数