def __setstate__(self, state): for attr in self._param_init_order: setattr(self, attr, state.pop(attr)) for attr in self.params: if attr in state: setattr(self, attr, state.pop(attr)) for k, v in state.items(): setattr(self, k, v) self._initialized = True if len(nengo.Network.context) > 0: warnings.warn(NotAddedToNetworkWarning(self))
def __setstate__(self, state): for k, v in state.items(): setattr(self, k, v) if len(Network.context) > 0: warnings.warn(NotAddedToNetworkWarning(self))