MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / train

Function train

imperative/python/test/integration/test_trace_dump.py:172–178  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

170
171 @trace(symbolic=True)
172 def train(d):
173 with gm:
174 loss = model(d)
175 gm.backward(loss)
176
177 optim.step().clear_grad()
178 return loss
179
180 @trace(symbolic=True)
181 def val(d):

Callers 1

test_ViTmode_trace_trainFunction · 0.70

Calls 4

modelFunction · 0.85
backwardMethod · 0.45
clear_gradMethod · 0.45
stepMethod · 0.45

Tested by

no test coverage detected