(self, model)
| 273 | self.hidden_size = hidden_size |
| 274 | |
| 275 | def create_states(self, model): |
| 276 | return [ |
| 277 | model.create_param( |
| 278 | param_name='initial_hidden_state', |
| 279 | initializer=Initializer(operator_name='ConstantFill', |
| 280 | value=0.0), |
| 281 | shape=[self.hidden_size], |
| 282 | ), |
| 283 | model.create_param( |
| 284 | param_name='initial_cell_state', |
| 285 | initializer=Initializer(operator_name='ConstantFill', |
| 286 | value=0.0), |
| 287 | shape=[self.hidden_size], |
| 288 | ) |
| 289 | ] |
| 290 | |
| 291 | |
| 292 | # based on https://pytorch.org/docs/master/nn.html#torch.nn.RNNCell |
no test coverage detected