mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-27 15:58:10 -05:00
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
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user