提交 b560252a 编写于 作者: N nihuini

handle batchnorm scale_factor zero, fix #302

上级 8f56e00b
......@@ -438,7 +438,7 @@ int main(int argc, char** argv)
}
else
{
float scale_factor = 1 / binlayer.blobs(2).data().data()[0];
float scale_factor = binlayer.blobs(2).data().data()[0] == 0 ? 0 : 1 / binlayer.blobs(2).data().data()[0];
// premultiply scale_factor to mean and variance
float tmp;
for (int j=0; j<mean_blob.data_size(); j++)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册