提交 620edabe authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Remove scan__debug config option

上级 c9a6f69e
...@@ -1462,13 +1462,6 @@ def add_scan_configvars(): ...@@ -1462,13 +1462,6 @@ def add_scan_configvars():
in_c_key=False, in_c_key=False,
) )
config.add(
"scan__debug",
"If True, enable extra verbose output related to scan",
BoolParam(False),
in_c_key=False,
)
def _get_default_gpuarray__cache_path(): def _get_default_gpuarray__cache_path():
return os.path.join(config.compiledir, "gpuarray_kernels") return os.path.join(config.compiledir, "gpuarray_kernels")
......
...@@ -553,12 +553,9 @@ class ReplaceValidate(History, Validator): ...@@ -553,12 +553,9 @@ class ReplaceValidate(History, Validator):
self, fgraph, replacements, reason=None, verbose=None, **kwargs self, fgraph, replacements, reason=None, verbose=None, **kwargs
): ):
chk = fgraph.checkpoint() chk = fgraph.checkpoint()
if verbose is None: if verbose is None:
verbose = config.optimizer_verbose verbose = config.optimizer_verbose
if config.scan__debug:
from aesara.scan.op import Scan
scans = [n for n in fgraph.apply_nodes if isinstance(n.op, Scan)]
for r, new_r in replacements: for r, new_r in replacements:
try: try:
...@@ -600,27 +597,10 @@ class ReplaceValidate(History, Validator): ...@@ -600,27 +597,10 @@ class ReplaceValidate(History, Validator):
f"optimizer: validate failed on node {r}.\n Reason: {reason}, {e}" f"optimizer: validate failed on node {r}.\n Reason: {reason}, {e}"
) )
raise raise
if config.scan__debug:
from aesara.scan.op import Scan
scans2 = [n for n in fgraph.apply_nodes if isinstance(n.op, Scan)]
nb = len(scans)
nb2 = len(scans2)
if nb2 > nb:
print(
"Extra scan introduced",
nb,
nb2,
getattr(reason, "name", reason),
r,
new_r,
)
elif nb2 < nb:
print(
"Scan removed", nb, nb2, getattr(reason, "name", reason), r, new_r
)
if verbose: if verbose:
print(f"optimizer: rewrite {reason} replaces {r} with {new_r}") print(f"optimizer: rewrite {reason} replaces {r} with {new_r}")
# The return is needed by replace_all_validate_remove # The return is needed by replace_all_validate_remove
return chk return chk
......
...@@ -232,14 +232,6 @@ import ``aesara`` and print the config variable, as in: ...@@ -232,14 +232,6 @@ import ``aesara`` and print the config variable, as in:
``False``, then Aesara will perform garbage collection during the inner ``False``, then Aesara will perform garbage collection during the inner
operations of a :class:`Scan` after each iterations. operations of a :class:`Scan` after each iterations.
.. attribute:: config.scan__debug
Bool value, either ``True`` or ``False``
Default: ``False``
If ``True``, Aesara will print extra :class:`Scan` debug information.
.. attribute:: cycle_detection .. attribute:: cycle_detection
String value, either ``regular`` or ``fast``` String value, either ``regular`` or ``fast```
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论