Skip to main content
torch.js has not been released yet.
torch.js logotorch.js logotorch.js
PlaygroundContact
Login
Documentation
IntroductionType SafetyTensor ExpressionsTensor IndexingEinsumEinopsAutogradTraining a ModelProfiling & MemoryPyTorch MigrationBest PracticesRuntimesPerformancePyTorch CompatibilityBenchmarksDType Coverage
torch.js· 2026
LegalTerms of UsePrivacy Policy
/
/
  1. docs
  2. Spark
  3. spark
  4. worker
  5. clearAllPersisted

spark.worker.clearAllPersisted

function clearAllPersisted(): void

Clear all persisted state.

Removes all persisted values, effectively resetting the worker state. Useful for cleanup or testing.

Examples

// Full reset before training new model
spark.clearAllPersisted();

// All subsequent persist() calls will reinitialize
const model = spark.persist('model', () => createNewModel());

See Also

  • clearPersisted - Clear single value
  • getPersistedKeys - See what's persisted
Previous
checkpoint
Next
clearExposed