mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 23:48:01 -05:00
hotfix: put that assign hack back
This commit is contained in:
@@ -59,7 +59,10 @@ class LazyBuffer:
|
||||
shape = self.shape if shape is None else shape
|
||||
return LazyBuffer.loadop(LoadOps.CONST, tuple(), self.dtype, self.device, arg=cast_scalar(val, self.dtype)).reshape((1,)*len(shape)).expand(shape)
|
||||
|
||||
def assign(self, x:LazyBuffer) -> LazyBuffer: return LazyBuffer.loadop(LoadOps.ASSIGN, self.shape, self.dtype, self.device, src=(x, self))
|
||||
def assign(self, x:LazyBuffer) -> LazyBuffer:
|
||||
if self.base.realized is not None or self is not self.base: new_self = self
|
||||
else: new_self = create_lazybuffer(self.device, self.st, self.dtype, self.op, self.arg, self.srcs, enable_cache=False)
|
||||
return LazyBuffer.loadop(LoadOps.ASSIGN, self.shape, self.dtype, self.device, src=(x, new_self))
|
||||
def contiguous(self):
|
||||
if not self.st.contiguous or self.size != self.base.size or self.is_unrealized_const():
|
||||
ret = self.e(LoadOps.CONTIGUOUS)
|
||||
|
||||
Reference in New Issue
Block a user