assert and tuple

This commit is contained in:
George Hotz
2022-06-27 09:19:54 -07:00
parent 37a6c0ef59
commit dbf4aa09db

View File

@@ -72,6 +72,7 @@ class LazyBuffer:
# in lazy mode, we don't log until we realize
log_op(self.optype, [x.op for x in get_lazyops(self.op)], self.realized, real_srcs)
del self.op
assert self.realized.shape == self.shape
return self.realized
@staticmethod
@@ -156,7 +157,7 @@ def elementwise_op(op, srcs:Tuple[LazyBuffer]) -> LazyBuffer:
#return LazyBuffer(out_shape, BinaryOps, LazyOp(op, list(srcs)))
srcs = [srcs[0].op, srcs[1]]
#srcs = [srcs[0], srcs[1].op]
return LazyBuffer(out_shape, ProcessingOps, LazyOp(op, srcs))
return LazyBuffer(out_shape, ProcessingOps, LazyOp(op, tuple(srcs)))
if MERGE_ELEMENTWISE_OPS:
# remove the buffers from any BinaryOps that feed into this