mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
corealize + remove realize from lazybuffer (#1968)
* corealize + remove realize from lazybuffer * fix multigpu * fix graph
This commit is contained in:
@@ -17,10 +17,8 @@ class Optimizer:
|
||||
for param in self.params: param.grad = None
|
||||
|
||||
def realize(self, extra=None):
|
||||
# TODO: corealize
|
||||
# NOTE: in extra is too late for most of the params due to issues with assign
|
||||
for p in extra + self.params + self.buffers if extra is not None else self.params + self.buffers:
|
||||
p.realize()
|
||||
Tensor.corealize(extra + self.params + self.buffers if extra is not None else self.params + self.buffers)
|
||||
|
||||
class SGD(Optimizer):
|
||||
def __init__(self, params: List[Tensor], lr=0.001, momentum=0, weight_decay=0.0, nesterov=False):
|
||||
|
||||
Reference in New Issue
Block a user