Args: x: tensor of shape (batch_size, sequence_len, in_size) 因为用的是 final_states ,所以特征的 padding 是放在前面的
(self, x)
| 61 | self.linear_1 = nn.Linear(hidden_size, hidden_size) |
| 62 | |
| 63 | def forward(self, x): |
| 64 | ''' |
| 65 | Args: |
| 66 | x: tensor of shape (batch_size, sequence_len, in_size) |
| 67 | 因为用的是 final_states ,所以特征的 padding 是放在前面的 |
| 68 | ''' |
| 69 | _, final_states = self.rnn(x) |
| 70 | h = self.dropout(final_states[0].squeeze(0)) |
| 71 | y_1 = self.linear_1(h) |
| 72 | return y_1 |
nothing calls this directly
no outgoing calls
no test coverage detected