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

torch-node.loadGPUProvider

function loadGPUProvider(): WGPU

Load the GPU provider based on environment configuration.

Attempts to load the GPU backend specified by the TORCH_GPU_BACKEND environment variable. If wgpu-native is selected but not installed, falls back to attempting to load Dawn. Throws an error if no suitable backend can be loaded.

Returns

WGPU– A WGPU instance from the loaded backend

See Also

  • getGPU
Previous
GPUBackend
Next
load