Skip to content

Commit

Permalink
_min_max for EXP2
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyuxyz committed Sep 10, 2024
1 parent 95c9fe8 commit 953183a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tinygrad/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ def _min_max(self) -> Tuple[ConstType, ConstType]:
if s1.arg < 0: return -(s0.vmax//-s1.arg), -(s0.vmin//-s1.arg)
if self.arg is BinaryOps.MAX: return max(s0.vmin, s1.vmin), max(s0.vmax, s1.vmax)
if self.arg is BinaryOps.CMPLT: return (s0.vmax<s1.vmin, s0.vmin<s1.vmax)
if self.arg is UnaryOps.EXP2: return math.exp2(s0.vmin), math.exp2(s0.vmax)
return dtypes.min(cast(DType, self.dtype)), dtypes.max(cast(DType, self.dtype))

@dataclass(frozen=True)
Expand Down

0 comments on commit 953183a

Please sign in to comment.