Skip to content

Commit 6da7816

Browse files
authored
assert Kernel ast.op to be Ops.SINK [pr] (tinygrad#9539)
rest of the code assumes self.ast is defined anyway
1 parent c33679c commit 6da7816

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tinygrad/codegen/kernel.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def fix_axes(self, removed_axis:int): # adjust the TC axes if necessary when a d
3737

3838
class Kernel:
3939
def __init__(self, ast:UOp, opts:Optional[Renderer]=None):
40-
if ast.op is Ops.SINK: self.ast = ast
40+
assert ast.op is Ops.SINK, ast.op
41+
self.ast = ast
4142

4243
self.opts = opts if opts is not None else Device[Device.DEFAULT].renderer
4344
# verify AST matches the spec

0 commit comments

Comments
 (0)