Skip to content

Commit

Permalink
add vmin vmax of SPECIAL
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyuxyz committed Jul 23, 2024
1 parent a85493b commit f3e335a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tinygrad/codegen/uops.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ def divides(self, v):
@functools.cached_property
def vmax(self) -> UOp:
if self.op is UOps.DEFINE_VAR: return self.src[1]
if self.op is UOps.SPECIAL: return self.const(dtypes.bigint, self.arg[1])
return UOp.const(dtypes.float, math.inf)
@functools.cached_property
def vmin(self) -> UOp:
if self.op is UOps.DEFINE_VAR: return self.src[0]
if self.op is UOps.SPECIAL: return self.const(dtypes.bigint, 0)
return UOp.const(dtypes.float, -math.inf)

class UPat:
Expand Down

0 comments on commit f3e335a

Please sign in to comment.