mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 23:48:01 -05:00
@@ -3307,9 +3307,7 @@ class Tensor(SimpleMathTrait):
|
||||
print(Tensor([-1, 2, 3]).maximum(Tensor([-4, -2, 9])).numpy())
|
||||
```
|
||||
"""
|
||||
# NOTE: the mid-point is for backward, revisit after new gradient API
|
||||
if self.is_floating_point(): return (self<x).detach().where(x, (self==x).detach().where(((self * 0.5 + x * 0.5).cast(self.dtype)), self))
|
||||
return (self<x).detach().where(x, self)
|
||||
return self._apply_broadcasted_uop(UOp.maximum, x)
|
||||
|
||||
def minimum(self, x:Union[Tensor, ConstType]) -> Tensor:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user