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

Method forward

imperative/python/test/unit/utils/test_cgtools.py:113–118  ·  view source on GitHub ↗
(self, input)

Source from the content-addressed store, hash-verified

111 )
112
113 def forward(self, input):
114 A = input.shape[0]
115 shape = astensor1d((A, A), self.data, dtype="int32", device=input.device)
116 x = F.reshape(self.data, shape)
117 o = input + x
118 return o
119
120 net = Net()
121 input = megengine.tensor(np.random.random((4, 4)), dtype=np.float32)

Callers

nothing calls this directly

Calls 2

astensor1dFunction · 0.90
reshapeMethod · 0.45

Tested by

no test coverage detected