MCPcopy Create free account
hub / github.com/Tencent/NeuralNLP-NeuralClassifier / forward

Method forward

model/layers.py:163–170  ·  view source on GitHub ↗
(self, x, gate_input=None, forward_input=None)

Source from the content-addressed store, hash-verified

161 self.transformer_gate = transformer_gate
162
163 def forward(self, x, gate_input=None, forward_input=None):
164 if gate_input is None:
165 gate_input = x
166 if forward_input is None:
167 forward_input = x
168 gate = self.transformer_gate(gate_input)
169 forward = self.transformer_forward(forward_input)
170 return gate * forward + (1 - gate) * x

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected