def reset(self):
        '''
            reset of LSTM hidden and cell states
        '''
        if self.rnn_config.if_rnn_policy:
            # Note that .detach() is necessary here to prevent overflow of memory
            # otherwise rollout in length of thousands will prevent previously
            # accumulated hidden/cell states from being freed.
            with tx.device_scope(self.gpu_ids):
                self.cells = (torch.zeros(self.rnn_config.rnn_layer,
                                          1,  # batch_size is 1
                                          self.rnn_config.rnn_hidden).detach(),
                              torch.zeros(self.rnn_config.rnn_layer,
                                          1,  # batch_size is 1
                                          self.rnn_config.rnn_hidden).detach())

            reset of LSTM hidden and cell states
        
surreal/agent/ppo_agent.py