把浏览器 GPU 计算 / 训练,塞进你自己的任意网站 —— 不需 npm、不需后端、不需写适配器
<script>,你的访客的 GPU 当场就能算:<script src="https://mox-site.pages.dev/webgpu/moxwebgpu.browser.js"></script>
<script>
MoxWebGPU.mox.init().then(gpu => {
gpu.tensor([1, 2, 3]).add(1).sum().then(r => console.log('结果 =', r));
});
</script>
window.MoxWebGPU,最省事:<script src="https://mox-site.pages.dev/webgpu/moxwebgpu.browser.js"></script>
<script>
const gpu = await MoxWebGPU.mox.init();
</script>
npm i @mox/moxwebgpu
import { mox } from '@mox/moxwebgpu';
const gpu = await mox.init();
import { mox } from 'https://esm.sh/@mox/moxwebgpu';
const gpu = await mox.init();
esbuild worker.ts --bundle \
--format=esm --outfile=dist/worker.js
正在初始化 WebGPU…