From b9c4f20d67bd768f5abecb2aa13ce78b57a83d72 Mon Sep 17 00:00:00 2001 From: Ricardo Vieira Date: Fri, 16 Jun 2023 14:31:59 +0200 Subject: [PATCH] Suppress optimizer verbose from MergeOptimizer when compiling inner fgraph C code of Composite Otherwise, it will show up everytime a Composite has been cached by th C backend --- pytensor/scalar/basic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytensor/scalar/basic.py b/pytensor/scalar/basic.py index 1e2b27daaf..16fee5c1c5 100644 --- a/pytensor/scalar/basic.py +++ b/pytensor/scalar/basic.py @@ -4236,7 +4236,8 @@ def fgraph(self): # the fgraph to be set to the variable as we need to pickle # them for the cache of c module to work. fgraph = FunctionGraph(self.inputs, self.outputs) - MergeOptimizer().rewrite(fgraph) + with config.change_flags(optimizer_verbose=False): + MergeOptimizer().rewrite(fgraph) for node in fgraph.apply_nodes: if not isinstance(node.op, ScalarOp): raise TypeError(