mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
late remove ones
This commit is contained in:
parent
d2473586d1
commit
dfb3e99b09
1 changed files with 2 additions and 0 deletions
|
|
@ -451,6 +451,8 @@ class Kernel:
|
|||
ret = op.replace(src=tuple(fixup_ast(x) for x in op.src)) # noqa: F821
|
||||
if op.op in GroupOp.Buffer and op in self.bufs:
|
||||
st = self.sts[self.bufs.index(op)]
|
||||
# late remove all ones
|
||||
st = st.reshape(tuple([x for x in st.shape if resolve(x != 1)]))
|
||||
# NOTE: if CONST got masked after applying opts, we create a new VALID
|
||||
if op.op is Ops.CONST and any(v.mask is not None for v in st.views): return op.view(st).valid()
|
||||
# otherwise we just replace the VIEW source
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue