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

Class Simple

imperative/python/test/unit/core/test_function.py:26–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 return grad_o * 10
25
26 class Simple(Module):
27 def __init__(self, a):
28 super().__init__()
29 self.a = Parameter(a, dtype=np.float32)
30 self.layer1 = MulFunc()
31
32 def forward(self):
33 x = self.layer1(self.a)
34 return x
35
36 net = Simple(av)
37 gm = ad.GradManager().attach(net.parameters())

Callers 9

test_single_inputFunction · 0.70
test_multi_inputFunction · 0.70
test_multi_outputFunction · 0.70
test_skip_invalid_gradFunction · 0.70
test_steFunction · 0.70
test_none_in_out_gradFunction · 0.70
test_clear_gradFunction · 0.70
test_multiple_gradFunction · 0.70
test_inplace_forwardFunction · 0.70

Calls

no outgoing calls

Tested by 9

test_single_inputFunction · 0.56
test_multi_inputFunction · 0.56
test_multi_outputFunction · 0.56
test_skip_invalid_gradFunction · 0.56
test_steFunction · 0.56
test_none_in_out_gradFunction · 0.56
test_clear_gradFunction · 0.56
test_multiple_gradFunction · 0.56
test_inplace_forwardFunction · 0.56