Skip to content

Commit

Permalink
DictionaryMemory: reset: handle empty previous_value
Browse files Browse the repository at this point in the history
  • Loading branch information
kmantel committed Feb 8, 2023
1 parent 58a4bea commit aa6c6dc
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"""

import copy
import numbers
import warnings
from collections import deque
Expand Down Expand Up @@ -2541,8 +2542,8 @@ def reset(self, previous_value=None, context=None):
previous_value = self._get_current_parameter_value("initializer", context)

if previous_value == []:
self.parameters.previous_value._get(context).clear()
value = np.ndarray(shape=(2, 0, len(self.defaults.variable[0])))
self.parameters.previous_value._set(copy.deepcopy(value), context)

else:
value = self._initialize_previous_value(previous_value, context=context)
Expand Down

0 comments on commit aa6c6dc

Please sign in to comment.