Skip to content

Commit 718b1f7

Browse files
committed
Don't name constants in inner Composite graph
1 parent 5b77cfb commit 718b1f7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pytensor/scalar/basic.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4246,7 +4246,11 @@ def __str__(self):
42464246
r.name = f"o{int(i)}"
42474247
io = set(self.fgraph.inputs + self.fgraph.outputs)
42484248
for i, r in enumerate(self.fgraph.variables):
4249-
if r not in io and len(self.fgraph.clients[r]) > 1:
4249+
if (
4250+
not isinstance(r, Constant)
4251+
and r not in io
4252+
and len(self.fgraph.clients[r]) > 1
4253+
):
42504254
r.name = f"t{int(i)}"
42514255

42524256
if len(self.fgraph.outputs) > 1 or len(self.fgraph.apply_nodes) > 10:

0 commit comments

Comments
 (0)