未验证 提交 2869c82d 编写于 作者: D Double_V 提交者: GitHub

fix division by zero (#935)

上级 adfaf72a
......@@ -265,7 +265,7 @@ class FilterPruner(Pruner):
baseline = eval_func()
plan = self.prune_var(var_name, dims, ratio)
pruned_metric = eval_func()
loss = (baseline - pruned_metric) / baseline + 1e-3
loss = (baseline - pruned_metric) / (baseline + 1e-3)
_logger.info("pruned param: {}; {}; loss={}".format(
var_name, ratio, loss))
sensitivities[var_name][ratio] = loss
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册