From 5c4cf62d2c1cf6ff5cd09929261bb0576ad24f71 Mon Sep 17 00:00:00 2001 From: chenyu Date: Wed, 20 Mar 2024 19:36:02 -0400 Subject: [PATCH] fix View.pad arg type (#3845) close #3779 --- 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 60c4e641a0..3300f885b9 100644 --- a/tinygrad/shape/view.py +++ b/tinygrad/shape/view.py @@ -214,7 +214,7 @@ class View: return View.create(tuple(s.b if isinstance(s, NumNode) else s for s in shape), self.strides, self.offset+offset, mask) @functools.lru_cache(maxsize=None) # pylint: disable=method-cache-max-size-none - def pad(self, arg: Tuple[Tuple[int, int], ...]) -> View: + def pad(self, arg: Tuple[Tuple[sint, sint], ...]) -> View: assert all((b>=0 and e>=0) for b,e in arg) and len(arg) == len(self.shape), f"{self.shape=}, {arg=}" if any(b or e for b, e in arg): zvarg = tuple([(-b,s+e) for s,(b,e) in zip(self.shape, arg)])