提交 66f13586 编写于 作者: M Megvii Engine Team

fix(mge/network): add warning when the node is not in the output list

GitOrigin-RevId: 324054613986c6b90a6ab101dc95eb58323eb7ec
上级 fe6299c5
......@@ -283,9 +283,16 @@ class Network:
for var in vars:
# use list pop instead of remove to avoid
# compare VarNode use elemwise equal
is_removed = False
for idx, out_var in enumerate(self.output_vars):
if var is out_var:
self.output_vars.pop(idx)
is_removed = True
if not is_removed:
logger.warning(
"Failed to remove {}({}). Please check whether "
"this node is in the output list.".format(var.name, id(var))
)
def add_dep_oprs(self, *vars):
if len(vars) == 0:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册