(self, inputs)
| 28 | bidirectional=config.birnn) |
| 29 | |
| 30 | def forward(self, inputs): |
| 31 | batch_size = inputs.size()[1] |
| 32 | state_shape = self.config.n_cells, batch_size, self.config.d_hidden |
| 33 | h0 = c0 = inputs.new_zeros(state_shape) |
| 34 | outputs, (ht, ct) = self.rnn(inputs, (h0, c0)) |
| 35 | return ht[-1] if not self.config.birnn else ht[-2:].transpose(0, 1).contiguous().view(batch_size, -1) |
| 36 | |
| 37 | |
| 38 | class SNLIClassifier(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected