Skip to content

Commit

Permalink
simple ignore mop noops [pr] (tinygrad#8263)
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot authored Dec 15, 2024
1 parent e1518f1 commit 53603c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tinygrad/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def view(self, new_st:ShapeTracker) -> UOp:

def _mop(self, op:Ops, arg):
ret = UOp(op, self.dtype, (self,), arg)
ret.st # pylint: disable=pointless-statement
if self.st == ret.st: return self # ignore NOOPs, also check ret.st
return ret

def reshape(self, arg:Tuple[sint, ...]): return self._mop(Ops.RESHAPE, arg)
Expand Down

0 comments on commit 53603c4

Please sign in to comment.