def state_dict(self) -> dict:
hidden_state = {}<EOL>if self.optimizer is not None:<EOL><INDENT>hidden_state['<STR_LIT>'] = self.optimizer.state_dict()<EOL><DEDENT>for callback in self.callbacks:<EOL><INDENT>callback.write_state_dict(self.training_info, hidden_state)<EOL><DEDENT>return hidden_state<EOL>
Calculate hidden state dictionary