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

Method forward

imperative/python/test/integration/test_grad_detach.py:17–20  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

15 self.b = Parameter([1.0], dtype=np.float32)
16
17 def forward(self, x):
18 x = x * self.a
19 x = x.detach() * self.b
20 return x
21
22
23def test_detach():

Callers

nothing calls this directly

Calls 1

detachMethod · 0.45

Tested by

no test coverage detected