MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / forward

Method forward

DeepSpeedExample/megatron/model/language_model.py:87–93  ·  view source on GitHub ↗
(self, hidden_states, sequence_index=0)

Source from the content-addressed store, hash-verified

85 self.dense = get_linear_layer(hidden_size, hidden_size, init_method)
86
87 def forward(self, hidden_states, sequence_index=0):
88 # hidden_states: [b, s, h]
89 # sequence_index: index of the token to pool.
90 pooled = hidden_states[:, sequence_index, :]
91 pooled = self.dense(pooled)
92 pooled = torch.tanh(pooled)
93 return pooled
94
95
96class Embedding(MegatronModule):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected