Skip to content

Commit eb1144b

Browse files
authored
hotfix: only check current graph when excluding nodes in viz (tinygrad#8930)
1 parent 3cc0508 commit eb1144b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tinygrad/viz/serve.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ def uop_to_json(x:UOp) -> dict[int, tuple[str, list[int], str]]:
4444
for u in (toposort:=x.toposort):
4545
# always exclude DEVICE/CONST
4646
if u.op in {Ops.DEVICE, Ops.CONST}: excluded.add(u)
47-
# only exclude CONST VIEW source if it has no other children
48-
if u.op is Ops.CONST and len(u.src) != 0 and all((cr:=c()) is None or cr.op is Ops.CONST for c in u.src[0].children): excluded.update(u.src)
47+
# only exclude CONST VIEW source if it has no other children in the graph
48+
if u.op is Ops.CONST and len(u.src) != 0 and all(cr.op is Ops.CONST for c in u.src[0].children if (cr:=c()) is not None and cr in toposort):
49+
excluded.update(u.src)
4950
for u in toposort:
5051
if u in excluded: continue
5152
argst = str(u.arg)

0 commit comments

Comments
 (0)