spark.worker.clearPersisted
function clearPersisted(key: string): voidClear a persisted value.
Removes a specific persisted value from memory. The next call to persist with the same key will reinitialize the value.
Parameters
keystring- Identifier of the persisted value to clear
Examples
// Reset model to start fresh
spark.clearPersisted('model');
// Next persist('model', ...) will run initializer again
const model = spark.persist('model', () => nn.Sequential(...));See Also
- persist - Persist a value
- clearAllPersisted - Clear all persisted state