(self, inputs, temporal_hidden_state=None, masks=None, spatial_hidden_state=None)
| 284 | return x, t_h, s_h |
| 285 | |
| 286 | def forward(self, inputs, temporal_hidden_state=None, masks=None, spatial_hidden_state=None): |
| 287 | if not params.use_rnn: |
| 288 | x = self.feature(inputs) |
| 289 | x = self.conv_to_flat(x) |
| 290 | return x |
| 291 | |
| 292 | if params.use_rnn and params.use_spatial_att is False: # TODO |
| 293 | x = self.feature(inputs) |
| 294 | x = self.conv_to_flat(x) |
| 295 | x, temporal_hidden_state = self._forward_gru(x, temporal_hidden_state, masks) |
| 296 | return x, temporal_hidden_state |
| 297 | |
| 298 | if params.use_rnn and params.use_spatial_att: |
| 299 | x = inputs |
| 300 | x, temporal_hidden_state, spatial_hidden_state, = self._forward_spatial_gru(x, temporal_hidden_state, masks, |
| 301 | spatial_hidden_state) |
| 302 | return x, temporal_hidden_state, spatial_hidden_state |
| 303 | |
| 304 | |
| 305 | class Shared_grad_buffers(): |
nothing calls this directly
no test coverage detected