mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-24 14:28:09 -05:00
fix typing in simplify_valid [pr] (#7216)
This commit is contained in:
@@ -133,7 +133,7 @@ def simplify_valid(valid:UOp) -> Optional[UOp]:
|
||||
ret:List[UOp] = []
|
||||
something_changed = False
|
||||
for stmt in split_uop(valid, BinaryOps.AND):
|
||||
ret.append(stmt if not ret else uop_given_valid(functools.reduce(operator.and_, ret), stmt))
|
||||
ret.append(newstmt if ret and (newstmt:=uop_given_valid(functools.reduce(operator.and_, ret), stmt)) is not None else stmt)
|
||||
if ret[-1] is not stmt: something_changed = True
|
||||
return functools.reduce(operator.and_, ret) if something_changed else None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user