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
IntroductionQuickstartClient APIWorker APIFile I/OBackends
getGPUBackendloadGPUProvidergetGPUBackendInfoGPUBackendsaveloadload_safetensorsSerializationFormatSaveOptionsLoadOptions
torch.js· 2026
LegalTerms of UsePrivacy Policy
/
/
  1. docs
  2. torch-node
  3. torch-node
  4. serialization
  5. LoadOptions

torch-node.serialization.LoadOptions

export interface LoadOptions {
  /**
   * Format to load. Default: `'auto'`
   *
   * When set to 'auto', the format is determined by:
   * 1. File extension (.safetensors, .pt, .pth)
   * 2. File content signature (safetensors magic bytes)
   * 3. Falls back to PyTorch format if detection fails
   */
  format?: SerializationFormat;
}
format(SerializationFormat)optional
– Format to load. Default: 'auto' When set to 'auto', the format is determined by: 1. File extension (.safetensors, .pt, .pth) 2. File content signature (safetensors magic bytes) 3. Falls back to PyTorch format if detection fails

Options for load.

Previous
load_safetensors
Next
save