提交 bbc56ebe authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add exception when epsilon is too small.

上级 3343d912
......@@ -11,8 +11,10 @@ int dnn_batchnorm_op(PyGpuArrayObject *inp, PyGpuArrayObject *scale,
if (c_set_tensorNd(scale, bn_params) != 0)
return 1;
if (epsilon < 1e-5)
if (epsilon < 1e-5) {
PyErr_Format(PyExc_ValueError, "epsilon must be at least 1e-5, got %f", epsilon);
return 1;
}
if (theano_prep_output(outp, inp->ga.nd, inp->ga.dimensions, inp->ga.typecode, GA_C_ORDER, c) != 0)
return 1;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论