Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions tfjs-backend-wasm/starter/webpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ Then we obtain the final serving path of the WASM binaries that were shipped on
NPM, and use `setWasmPaths` to let the library know the serving locations:

```ts
import {setWasmPath} from '@tensorflow/tfjs-backend-wasm';
import wasmPath from '../node_modules/@tensorflow/tfjs-backend-wasm/dist/tfjs-backend-wasm.wasm';
setWasmPaths(null /* custom prefix */, {'tfjs-backend-wasm.wasm': wasmPath});
import {setWasmPaths} from '@tensorflow/tfjs-backend-wasm';

import wasmSimdPath from './node_modules/@tensorflow/tfjs-backend-wasm/dist/tfjs-backend-wasm-simd.wasm';
import wasmSimdThreadedPath from './node_modules/@tensorflow/tfjs-backend-wasm/dist/tfjs-backend-wasm-threaded-simd.wasm';
import wasmPath from './node_modules/@tensorflow/tfjs-backend-wasm/dist/tfjs-backend-wasm.wasm';

setWasmPaths({
'tfjs-backend-wasm.wasm': wasmPath,
'tfjs-backend-wasm-simd.wasm': wasmSimdPath,
'tfjs-backend-wasm-threaded-simd.wasm': wasmSimdThreadedPath
});
```