human/tfjs/tf-browser.ts

64 lines
2.8 KiB
TypeScript
Raw Normal View History

2021-05-25 14:58:20 +02:00
/**
* Creates tfjs bundle used by Human browser build target
2021-06-07 01:00:34 +02:00
* @external
2021-05-25 14:58:20 +02:00
*/
2021-06-06 18:58:06 +02:00
// import from dist
// get versions of all packages
2021-06-07 01:00:34 +02:00
/*
2021-02-17 16:22:38 +01:00
import * as packageBundle from '@tensorflow/tfjs/package.json';
import * as packageCore from '@tensorflow/tfjs-core/package.json';
import * as packageData from '@tensorflow/tfjs-data/package.json';
import * as packageLayers from '@tensorflow/tfjs-layers/package.json';
import * as packageConverter from '@tensorflow/tfjs-converter/package.json';
2021-06-07 02:34:29 +02:00
// for backends, get version from source to avoid incorrect tree shaking
2020-11-18 14:26:28 +01:00
import { version_cpu } from '@tensorflow/tfjs-backend-cpu/dist/index.js';
import { version_webgl } from '@tensorflow/tfjs-backend-webgl/dist/index.js';
import { version_wasm } from '@tensorflow/tfjs-backend-wasm/dist/index.js';
2021-06-06 18:58:06 +02:00
// export all
2020-11-18 14:26:28 +01:00
export * from '@tensorflow/tfjs-core/dist/index.js';
export * from '@tensorflow/tfjs-layers/dist/index.js';
export * from '@tensorflow/tfjs-converter/dist/index.js';
export * as data from '@tensorflow/tfjs-data/dist/index.js';
export * from '@tensorflow/tfjs-backend-cpu/dist/index.js';
export * from '@tensorflow/tfjs-backend-webgl/dist/index.js';
export * from '@tensorflow/tfjs-backend-wasm/dist/index.js';
2021-06-07 01:00:34 +02:00
*/
2020-11-18 14:26:28 +01:00
2021-06-06 18:58:06 +02:00
// import from src
// get versions of all packages
2021-06-07 01:00:34 +02:00
import { version as tfjsVersion } from '@tensorflow/tfjs/package.json';
import { version as tfjsCoreVersion } from '@tensorflow/tfjs-core/package.json';
import { version as tfjsDataVersion } from '@tensorflow/tfjs-data/package.json';
import { version as tfjsLayersVersion } from '@tensorflow/tfjs-layers/package.json';
import { version as tfjsConverterVersion } from '@tensorflow/tfjs-converter/package.json';
import { version as tfjsBackendCPUVersion } from '@tensorflow/tfjs-backend-cpu/package.json';
import { version as tfjsBackendWebGLVersion } from '@tensorflow/tfjs-backend-webgl/package.json';
import { version as tfjsBackendWASMVersion } from '@tensorflow/tfjs-backend-wasm/package.json';
2021-06-06 18:58:06 +02:00
// export all
2021-06-07 02:34:29 +02:00
// requires treeShaking:ignore-annotations due to tfjs misconfiguration
2021-04-08 18:10:15 +02:00
export * from '@tensorflow/tfjs-core/src/index';
export * from '@tensorflow/tfjs-layers/src/index';
export * from '@tensorflow/tfjs-converter/src/index';
export * as data from '@tensorflow/tfjs-data/src/index';
export * from '@tensorflow/tfjs-backend-cpu/src/index';
export * from '@tensorflow/tfjs-backend-webgl/src/index';
export * from '@tensorflow/tfjs-backend-wasm/src/index';
2021-06-07 01:00:34 +02:00
/*
2021-04-08 18:10:15 +02:00
*/
2020-11-18 14:26:28 +01:00
// export versions
export const version = {
2021-06-07 01:00:34 +02:00
tfjs: tfjsVersion,
'tfjs-core': tfjsCoreVersion,
'tfjs-data': tfjsDataVersion,
'tfjs-layers': tfjsLayersVersion,
'tfjs-converter': tfjsConverterVersion,
'tfjs-backend-cpu': tfjsBackendCPUVersion,
'tfjs-backend-webgl': tfjsBackendWebGLVersion,
'tfjs-backend-wasm': tfjsBackendWASMVersion,
2020-11-18 14:26:28 +01:00
};
2021-04-08 18:10:15 +02:00
// export const version = {};