diff --git a/tinygrad/schedule/rangeify.py b/tinygrad/schedule/rangeify.py index f1f5e49b01..b5ccb31c00 100644 --- a/tinygrad/schedule/rangeify.py +++ b/tinygrad/schedule/rangeify.py @@ -249,6 +249,9 @@ pm_rangeify = pm_mops+PatternMatcher([ (UPat(Ops.INDEX, src=(UPat(Ops.CHILD, src=(UPat(name="c"), ), name="x"),), allow_any_len=True, name="idx"), index_child), (UPat(Ops.INDEX, src=(UPat(Ops.CHILDREN, name="c"),), allow_any_len=True, name="idx"), children_gate), + # if we come across this, remove it. it was a CHILD unused in an INDEX + (UPat(Ops.CHILD, src=(UPat(Ops.CHILDREN, src=(UPat.var("x"),)),)), lambda x: x), + # if there's an INDEX it can support partial contig (UPat(Ops.INDEX, src=(UPat(Ops.CONTIGUOUS, src=(UPat(),), name="x"),), allow_any_len=True, name="idx"), map_contiguous),