提交 39af8a86 authored 作者: Robert P. Goldman's avatar Robert P. Goldman 提交者: Michael Osthege

Add prefixes to optimization warnings.

These prefixes -- applied to warnings where optimization is impossible because there is no C implementation -- are required to enable the logger to filter out redundant warnings.
上级 b379b0f2
...@@ -7571,6 +7571,7 @@ def local_elemwise_fusion_op(op_class, max_input_fct=lambda node: 32, maker=None ...@@ -7571,6 +7571,7 @@ def local_elemwise_fusion_op(op_class, max_input_fct=lambda node: 32, maker=None
except (NotImplementedError, MethodNotDefined): except (NotImplementedError, MethodNotDefined):
_logger.warning( _logger.warning(
( (
"Optimization Warning: "
f"The Op {i.owner.op.scalar_op} does not provide a C implementation." f"The Op {i.owner.op.scalar_op} does not provide a C implementation."
" As well as being potentially slow, this also disables " " As well as being potentially slow, this also disables "
"loop fusion." "loop fusion."
...@@ -7637,9 +7638,11 @@ your code will run correctly, but may be slower.""" ...@@ -7637,9 +7638,11 @@ your code will run correctly, but may be slower."""
{"fail": "%(fail)s"}, {"fail": "%(fail)s"},
) )
except (NotImplementedError, MethodNotDefined): except (NotImplementedError, MethodNotDefined):
name = str(s_new_out[0].owner.op)
_logger.warning( _logger.warning(
( (
f"The Op {s_new_out[0].owner.op} does not provide a C implementation." "Optimization Warning: "
f"The Op {name} does not provide a C implementation."
" As well as being potentially slow, this also disables " " As well as being potentially slow, this also disables "
"loop fusion." "loop fusion."
) )
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论