Skip to content

Commit

Permalink
Add prefixes to optimization warnings.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rpgoldman authored and Michael Osthege committed Jan 22, 2021
1 parent b379b0f commit 39af8a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion theano/tensor/opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7571,6 +7571,7 @@ def local_fuse(fgraph, node):
except (NotImplementedError, MethodNotDefined):
_logger.warning(
(
"Optimization Warning: "
f"The Op {i.owner.op.scalar_op} does not provide a C implementation."
" As well as being potentially slow, this also disables "
"loop fusion."
Expand Down Expand Up @@ -7637,9 +7638,11 @@ def local_fuse(fgraph, node):
{"fail": "%(fail)s"},
)
except (NotImplementedError, MethodNotDefined):
name = str(s_new_out[0].owner.op)
_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 "
"loop fusion."
)
Expand Down

0 comments on commit 39af8a8

Please sign in to comment.