MCPcopy
hub / github.com/tinygrad/tinygrad / forward

Method forward

test/backend/test_optim.py:29–34  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27 self.m = tensor(m_init.copy())
28
29 def forward(self):
30 out = self.x.matmul(self.W).relu()
31 # print(out.detach().numpy())
32 out = out.log_softmax(1)
33 out = out.mul(self.m).add(self.m).sum()
34 return out
35
36def step(tensor, optim, steps=1, teeny=False, **kwargs):
37 net = TeenyNet(tensor) if teeny else TinyNet(tensor)

Callers 1

stepFunction · 0.45

Calls 6

reluMethod · 0.80
matmulMethod · 0.80
log_softmaxMethod · 0.80
sumMethod · 0.80
mulMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected