From 06a28d83f510640b9c076bcbe94ccf8599e2a350 Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Sun, 24 Nov 2024 11:06:52 -0500 Subject: [PATCH] delete extra dtype check in uop const [pr] (#7880) --- tinygrad/ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/ops.py b/tinygrad/ops.py index 6c608e289f..a4339f64ae 100644 --- a/tinygrad/ops.py +++ b/tinygrad/ops.py @@ -333,7 +333,7 @@ class UOp(MathTrait, metaclass=UOpMetaClass): def const(dtype:DType, b:ConstLike): if isinstance(b, UOp): return b.unbind()[0] if b.op is Ops.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(Ops.VCONST if isinstance(b, tuple) else Ops.CONST, dtype, arg=dtypes.as_const(b, dtype) if dtype is not None else b) + return UOp(Ops.VCONST if isinstance(b, tuple) else Ops.CONST, dtype, arg=dtypes.as_const(b, dtype)) @staticmethod def range(dtype:DType, start:ConstType|UOp, end:ConstType|UOp, idx:int): return UOp(Ops.RANGE, dtype=dtype, src=(UOp.const(dtype, start) if not isinstance(start, UOp) else start,