From f01192b8cda4192d5c716ba76331e3a52badebb6 Mon Sep 17 00:00:00 2001 From: chenyu Date: Tue, 9 Jul 2024 23:37:53 -0400 Subject: [PATCH] tiny View.unbind cleanup [run_process_replay] (#5355) `Variable.val` asserts if it's None, so unbind does not need to check if `.val` is not None --- 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 a5153a6cec..90f5cd4e81 100644 --- a/tinygrad/shape/view.py +++ b/tinygrad/shape/view.py @@ -121,7 +121,7 @@ class View: @functools.lru_cache(None) # pylint: disable=method-cache-max-size-none def unbind(self) -> Tuple[View, Dict[Variable, int]]: - var_unboundvar_val = [(v, v.unbind()) for v in self.vars() if v.val is not None] + var_unboundvar_val = [(v, v.unbind()) for v in self.vars()] unbound_vars = {v:uv for v,(uv,_) in var_unboundvar_val} new_shape = tuple([s if isinstance(s, int) else s.substitute(unbound_vars) for s in self.shape]) new_strides = tuple([s if isinstance(s, int) else s.substitute(unbound_vars) for s in self.strides])