simpler unbind_view [pr] (#10636)

This commit is contained in:
chenyu
2025-06-05 01:03:27 -04:00
committed by GitHub
parent d0969f5a1f
commit f6d7db25b7

View File

@@ -21,7 +21,8 @@ def unbind_view(ctx:list[dict[Variable, int]], x:UOp):
if any(x.op is Ops.BIND for x in st.vars()):
st, var_vals = st.unbind()
ctx.append(var_vals)
return x.replace(arg=st) if st != x.st else None
return x.replace(arg=st)
return None
def unbind_bind(ctx:list[dict[Variable, int]], x:UOp):
var, val = x.unbind()