use op_in_parents (#12385)

This commit is contained in:
George Hotz
2025-10-01 12:37:29 +08:00
committed by GitHub
parent 0662946fac
commit e02da8f5ac
+1 -1
View File
@@ -99,7 +99,7 @@ def extract_children(ctx:ChildrenContext, x:UOp):
non_sink_children = [u for u in v if u.op is not Ops.SINK]
if len(non_sink_children) <= 1: continue
# NOTE: this gate shouldn't be here
if any(x.op is Ops.REDUCE_AXIS for x in k.toposort()) and any(x.op in {Ops.BUFFER, Ops.CONTIGUOUS} for x in k.toposort()):
if k.op_in_parents(Ops.REDUCE_AXIS) and k.op_in_parents(Ops.BUFFER, Ops.CONTIGUOUS):
ctx.children[k] = non_sink_children
def mark_children(ctx:ChildrenContext, x:UOp):