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

Function func

imperative/python/test/unit/xla/functional/test_xla_nn.py:37–50  ·  view source on GitHub ↗
(x, w, b, dy)

Source from the content-addressed store, hash-verified

35
36 @jit.xla_trace(without_host=True)
37 def func(x, w, b, dy):
38 gm.attach([x, w, b])
39 with gm:
40 y = F.conv2d(
41 x,
42 w,
43 b,
44 stride=stride,
45 padding=padding,
46 groups=groups,
47 compute_mode=cm,
48 )
49 gm.backward(y, dy)
50 return [y, x.grad, w.grad, b.grad]
51
52 mge_rsts = func(x, w, b, dy)
53 xla_rsts = func(x, w, b, dy)

Callers 1

testerFunction · 0.70

Calls 2

attachMethod · 0.45
backwardMethod · 0.45

Tested by

no test coverage detected