(self, hidden_states, sequence_index=0)
| 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 | |
| 96 | class Embedding(MegatronModule): |
nothing calls this directly
no outgoing calls
no test coverage detected