更新时间:2021-09-16 01:47:31
在您的情况下,这意味着b
在数组中的某个地方非常小,并且您得到一个数字( a/b
或exp(log(a) - log(b))
)对于您用于存储输出的数组的任何dtype(float32,float64等)都太大.
In your case, it means that b
is very small somewhere in your array, and you're getting a number (a/b
or exp(log(a) - log(b))
) that is too large for whatever dtype (float32, float64, etc) the array you're using to store the output is.
Numpy可以配置为
Numpy can be configured to
请参见 numpy.seterr
以控制它的方式处理浮点数组中的下溢/上溢等.
See numpy.seterr
to control how it handles having under/overflows, etc in floating point arrays.