From 19f07e72f675e5ded93ff5ca91dfd78032be95e1 Mon Sep 17 00:00:00 2001 From: Sieds Lykles <93992551+S-Lykles@users.noreply.github.com> Date: Thu, 3 Jul 2025 20:37:59 +0200 Subject: [PATCH] Fix division by zero in add views (#11075) --- tinygrad/shape/view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/shape/view.py b/tinygrad/shape/view.py index 85a781690c..ed74ade451 100644 --- a/tinygrad/shape/view.py +++ b/tinygrad/shape/view.py @@ -198,7 +198,7 @@ class View: for d1, st in enumerate(vm1.strides): if st == 0: continue for d2, (o, s1) in enumerate(zip(origin, unravel(vm2.shape, vm1.offset + st))): - if (s1 := s1 - o) == 0: continue + if not resolve((s1 := s1 - o)!=0): continue # if s1 can possible be 0 terms[d2].append((d1, s1)) strides[d1] += s1 * vm2.strides[d2]