fix GPU sign...these tests aren't very good
MODIFY
tinygrad/ops_gpu.py
tinygrad/ops_gpu.py
@@ -67,7 +67,7 @@ class Exp(Function):
class Sign(Function):
@staticmethod
def forward(ctx, input):
- return unary_op(ctx, 'a >= 0', input)
+ return unary_op(ctx, '(a > 0) - (a < 0)', input)
@staticmethod
def backward(ctx, grad_output):

MODIFY
tinygrad/tensor.py
tinygrad/tensor.py
@@ -274,7 +274,7 @@ class Tensor:
return self * (self.softplus().tanh()) # x*tanh(softplus(x))
def abs(self):
- return self.relu() + (-1.0*self).relu()
+ return self * self.sign()
def _pool2d(self, py, px):
xup = self[:, :, :self.shape[2]-self.shape[2]%py, :self.shape[3]-self.shape[3]%px]

fix GPU sign...these tests aren't very good