remove outdated comments (#7018)

This commit is contained in:
chenyu 2024-10-12 10:51:07 -04:00 committed by GitHub
commit 23faeacb23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 0 additions and 3 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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