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

Method forward

imperative/python/test/integration/test_trace_dump.py:153–161  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

151 self.head = M.Linear(embed_dim, 1)
152
153 def forward(self, x):
154 x = self.proj(x)
155 x = F.flatten(x, 2).transpose(0, 2, 1)
156
157 x = self.extra(x)
158 x = x.mean(axis=1)
159 x = self.head(x)
160 x = x.sum()
161 return x
162
163
164def test_ViTmode_trace_train():

Callers

nothing calls this directly

Calls 4

transposeMethod · 0.45
flattenMethod · 0.45
meanMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected