MCPcopy Create free account
hub / github.com/LeapLabTHU/DAT / forward

Method forward

models/dat.py:34–38  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

32 self.weight = nn.Parameter(torch.ones(dim) * init_values)
33
34 def forward(self, x):
35 if self.inplace:
36 return x.mul_(self.weight.view(-1, 1, 1))
37 else:
38 return x * self.weight.view(-1, 1, 1)
39
40class TransformerStage(nn.Module):
41

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected