From e8d9da936d529cbe6d594de432139bed31d7755d Mon Sep 17 00:00:00 2001 From: qazal Date: Thu, 31 Oct 2024 11:33:56 +0200 Subject: [PATCH] dont unbind in ops --- tinygrad/ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/ops.py b/tinygrad/ops.py index 5a576675d6..efe0c86da3 100644 --- a/tinygrad/ops.py +++ b/tinygrad/ops.py @@ -330,7 +330,7 @@ class UOp(MathTrait, metaclass=UOpMetaClass): return UOp(UOps.ALU, out_dtype, (self,)+src, arg) @staticmethod def const(dtype:DType, b:Tuple[ConstType, ...]|ConstType|Variable): - if isinstance(b, UOp): return b.unbind()[0] if b.op is UOps.BIND else b + if isinstance(b, UOp): return 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 @staticmethod