From 3667200df5cf56af40cfd8e993cc15897c135376 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Wed, 15 Jun 2022 20:03:43 -0700 Subject: [PATCH] remove unused unstride --- tinygrad/shapetracker.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tinygrad/shapetracker.py b/tinygrad/shapetracker.py index efb2bd405a..da00861138 100644 --- a/tinygrad/shapetracker.py +++ b/tinygrad/shapetracker.py @@ -100,14 +100,6 @@ class ShapeTracker: offset = sum([(s-1)*z for s,z,m in zip(self.shape,old_strides,mul) if m < 0]) self.views.append(View(new_shape, strides, offset)) - # TODO: is there a better name for this? - # TODO: this shouldn't be in shapetracker, this should be in mlops - def unstride(self, *mul): - start_shape = self.shape - self.reshape(*reduce(lambda x,y: x+[y,1], start_shape, [])) - self.slice([(0,x) for x in chain(*zip(start_shape, mul))]) - self.reshape([s*m for s,m in zip(start_shape, mul)]) - # TODO: this is a special case of slice with strides, remove it def flip(self, *axis): self.stride(*[-1 if i in axis else 1 for i in range(len((self.shape)))])