(self, input: Tensor, hx=None)
| 291 | return stack(h_n, axis=0) |
| 292 | |
| 293 | def forward(self, input: Tensor, hx=None): |
| 294 | if self.batch_first: |
| 295 | batch_size = input.shape[0] |
| 296 | input = input.transpose((1, 0, 2)) # [seq_len, batch_size, dim] |
| 297 | else: |
| 298 | batch_size = input.shape[1] |
| 299 | if hx is None: |
| 300 | hx = self.init_hidden(batch_size) |
| 301 | |
| 302 | output, h = self.apply_op(input, hx) |
| 303 | if self.batch_first: |
| 304 | output = output.transpose((1, 0, 2)) |
| 305 | return output, h |
| 306 | |
| 307 | |
| 308 | class RNN(RNNBase): |
nothing calls this directly
no test coverage detected