From 2fc8bf115d1a5dbcb864b99d5acff1541ebbe718 Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Wed, 19 Feb 2025 12:10:18 +0200 Subject: [PATCH] remove support for VIEW with two sources in ops [pr] (#9168) * only 1 src views can exist [pr] * views can still exist without a base, this is a separate project --- tinygrad/ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinygrad/ops.py b/tinygrad/ops.py index 97dac874f2..4eeca551d5 100644 --- a/tinygrad/ops.py +++ b/tinygrad/ops.py @@ -509,7 +509,7 @@ class UOp(MathTrait, metaclass=UOpMetaClass): @property def base(self) -> UOp: - if (self.op is Ops.VIEW and len(self.src) == 1) or self.op in GroupOp.Movement: return self.src[0].base + if (self.op is Ops.VIEW and len(self.src) != 0) or self.op in GroupOp.Movement: return self.src[0].base return self def view(self, new_st:ShapeTracker) -> UOp: return UOp(Ops.VIEW, self.dtype, (self.base,), new_st) @@ -546,7 +546,7 @@ class UOp(MathTrait, metaclass=UOpMetaClass): @property def buf_uop(self) -> UOp: if self.base.op is Ops.BUFFER: return self.base - assert self.base.op in {*GroupOp.Buffer, Ops.ASSIGN, Ops.VIEW}, f"buf_uop called on {self.op}" + assert self.base.op in {*GroupOp.Buffer, Ops.ASSIGN}, f"buf_uop called on {self.op}" return self.src[0].buf_uop @property def buffer(self) -> Buffer: