Skip to content

bwasti/webtorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webtorch

All 21MB of Python in PyTorch shimmed to at least load on the web (check out everything in this file, and these minimal changes to the baseline source). Nothing works and the only (broken) function can be found in index.html (randn):

  pyodide.registerJsModule('torch_shim', {
    js_global_shim: pyodide.toPy({
      randn: (...args) => { return pyodide.toPy({shape: [...args]}) }
    })
  })

then in the browser:

import torch
torch.randn(128, 128)

Theoretically this could be used to shim all the native ops in PyTorch while preserving things like fx, functorch and full execution of generic scripts in the browser. jit would be immensely difficult to shim, as well as cuda related functionality.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages