Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions tfjs-backend-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"publish-local": "rimraf dist/ && yarn build && rollup -c && yalc push",
"build-ci": "./scripts/build-ci.sh",
"build-npm": "./scripts/build-npm.sh",
"build-fast": "tsc && yarn rollup -c",
"build-benchmark": "./scripts/build-benchmark.sh",
"buildifier-ci": "./scripts/buildifier-ci.sh",
"clean": "rimraf dist/ && bazel clean --expunge",
Expand Down
19 changes: 19 additions & 0 deletions tfjs-backend-wasm/src/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/

export {BackendWasm, setWasmPath, setWasmPaths} from './backend_wasm';
export {version as version_wasm} from './version';
4 changes: 1 addition & 3 deletions tfjs-backend-wasm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@
*/

import './register_all_kernels';

export {BackendWasm, setWasmPath, setWasmPaths} from './backend_wasm';
export {version as version_wasm} from './version';
export * from './base';
3 changes: 2 additions & 1 deletion tfjs/tools/custom_bundle/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ function validateArgs(): CustomTFJSBundleConfig {

for (const requestedBackend of finalConfig.backends) {
if (requestedBackend !== SupportedBackends.cpu &&
requestedBackend !== SupportedBackends.webgl) {
requestedBackend !== SupportedBackends.webgl &&
requestedBackend !== SupportedBackends.wasm) {
bail(`Error: Unsupported backend specified '${requestedBackend}'`);
}
}
Expand Down
2 changes: 2 additions & 0 deletions tfjs/tools/custom_bundle/esm_module_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ function getBackendPath(backend: SupportedBackend) {
return '@tensorflow/tfjs-backend-cpu';
case 'webgl':
return '@tensorflow/tfjs-backend-webgl';
case 'wasm':
return '@tensorflow/tfjs-backend-wasm';
default:
throw new Error(`Unsupported backend ${backend}`);
}
Expand Down
3 changes: 2 additions & 1 deletion tfjs/tools/custom_bundle/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

export enum SupportedBackends {
cpu = 'cpu',
webgl = 'webgl'
webgl = 'webgl',
wasm = 'wasm'
}
export type SupportedBackend = keyof typeof SupportedBackends;

Expand Down