def _recusiveReplaceArrayWithPlaceholder(self, state):
arrays = {}<EOL>def recursive(state):<EOL><INDENT>for key, val in state.items():<EOL><INDENT>if isinstance(val, dict):<EOL><INDENT>recursive(val)<EOL><DEDENT>else:<EOL><INDENT>if isinstance(val, np.ndarray):<EOL><INDENT>name = '<STR_LIT>' % recursive.c<EOL>arrays[name] = val<EOL>state[key] = name<EOL>recursive.c += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT><DEDENT>recursive.c = <NUM_LIT:0><EOL>recursive(state)<EOL>return arrays<EOL>
replace all numpy.array within the state dict
with a placeholder
this allows to save the arrays extra using numpy.save_compressed