diff --git a/tinygrad/dtype.py b/tinygrad/dtype.py index 8a2adb18ff..a440754e8d 100644 --- a/tinygrad/dtype.py +++ b/tinygrad/dtype.py @@ -84,7 +84,6 @@ class dtypes: return {dtypes.float16: (5, 10), dtypes.bfloat16: (8, 7), dtypes.float32: (8, 23), dtypes.float64: (11, 52)}[dtype] @staticmethod def fields() -> Dict[str, DType]: return DTYPES_DICT - # TODO: priority should be higher than bool void: Final[DType] = DType(-1, 0, "void", None, 1) bool: Final[DType] = DType(0, 1, "bool", '?', 1) int8: Final[DType] = DType(1, 1, "char", 'b', 1) diff --git a/tinygrad/function.py b/tinygrad/function.py index b27a2e6a4f..70169cb858 100644 --- a/tinygrad/function.py +++ b/tinygrad/function.py @@ -39,7 +39,6 @@ class Sin(Function): def backward(self, grad_output:LazyBuffer) -> LazyBuffer: return (math.pi/2 - self.x).sin() * grad_output -# NOTE: maximum(x, 0) behaves differently where x=0 class Relu(Function): def forward(self, x:LazyBuffer) -> LazyBuffer: self.ret = x.max(0) diff --git a/tinygrad/ops.py b/tinygrad/ops.py index cbf0cf0c47..b2e5e00fde 100644 --- a/tinygrad/ops.py +++ b/tinygrad/ops.py @@ -283,7 +283,6 @@ class UOp(MathTrait): return UOp(UOps.ALU, out_dtype, (self,)+src, arg) @staticmethod def const(dtype:DType, b:Tuple[ConstType, ...]|ConstType|Variable): - # TODO: fix dtype of b.max after Variable is just an UOp if isinstance(b, UOp): return b.unbind()[0] if b.op is UOps.BIND else b if isinstance(b, tuple) and all_same(b): b = b[0] # doesn't have to be a VCONST if they are all the same return UOp(UOps.VCONST if isinstance(b, tuple) else UOps.CONST, dtype, arg=dtypes.as_const(b, dtype) if dtype is not None else b) # type: ignore