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

Function run

imperative/python/test/integration/test_param_pack.py:48–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46 gm = ad.GradManager().attach(net.parameters(), callbacks=[allreduce_cb])
47
48 def run():
49 opt.clear_grad()
50 with gm:
51 x = tensor(data)
52 loss = net(x)
53 loss = loss.sum()
54 gm.backward(loss)
55
56 for i in range(n_iters):
57 run()

Callers 1

workerFunction · 0.70

Calls 3

clear_gradMethod · 0.45
sumMethod · 0.45
backwardMethod · 0.45

Tested by

no test coverage detected