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. getPersistedKeys

spark.worker.getPersistedKeys

function getPersistedKeys(): string[]

Get all persisted keys.

Returns the list of all values currently persisted in memory. Useful for debugging or state inspection.

Returns

string[]– Array of all persisted key names

Examples

const keys = spark.getPersistedKeys();
console.log('Persisted state:', keys);
// Output: ['model', 'optimizer', 'best_loss']
Previous
getPendingReloadCode
Next
getRpc