This is a public release candidate for TensorFlow.js 2.0. It is available on NPM as well as CDNs that sync from NPM. Since it is a release candidate you will need to opt into it by explicitly putting tfjs-2.0.0-rc.4
into your package.json or script tags.
It contains a few breaking changes, details of which are listed below, but at a high level these are some of the major changes in this release:
- The CPU and WebGL backends have moved out of tfjs-core into their own packages. tfjs-backend-cpu and tfjs-backend-webgl.
- If you are not using the union package (i.e. you use tfjs-core, tfjs-layers, tfjs-converter, tfjs-data directly) you need to import these backends into your application to get the same behavior as before, or you can only import a single backend if that is all you need.
- If you use the union package (i.e. tfjs), then nothing will need to change in your code as these backends are already included.
- In addition to our ES5 bundles, we are shipping new pre-compiled bundles with ES modules and ES2017 code:
- tf.min.js & tf.es2017.min.js
- tf-core.min.js & tf-core.es2017.min.js
- tf-backend-cpu.min.js & tf-backend-cpu.es2017.min.js
- tf-backend-webgl.min.js & tf-backend-webgl.es2017.min.js
- tf-layers.min.js & tf-layers.es2017.min.js
- tf-converter.min.js & tf-converter.es2017.min.js
- tf-data.min.js & tf-data.es2017.min.js
- Our 'module' entry in package.json points to files with ES modules and ES2017 code. These are individual files corresponding to the source code of our libraries. This lays down a path to enable tree shaking and smaller bundles in apps.
- If you have previously been using the files in the 'dist' subfolder of our NPM package, you may need to adjust your build system to consume them.
- Functionality that was deprecated in 1.x has been removed.
- In 2.x we are deprecating all the '*Strict' variants of ops. e.g. divStrict and mulStrict.
Core (1.7.4 ==> 2.0.0-rc.4)
Features
- [wasm] Add split, sqrt kernels. (#3183).
Breaking changes
- Remove deprecated batchnormalization op (#3238).
- Update packages to compile to ESM modules by default (#3112).
- move webgl backend out of core (#3056).
- Move cpu backend out of tfjs-core (#3008).
Bug fixes
- Restrict size of conv test output to temporarily fix precision issues in Safari. [[core] Restrict size of conv test output to temporarily fix precision issues in Safari.] (#3187).
- Change inputs to matMul test to avoid precision issues in Safari as stopgap. [[core] Change inputs to matMul test to avoid precision issues in Safari as stopgap.] (#3142).
- fix nightly error on isMobile (#3139).
- [webgpu] Fix dilation and add stride 2 filter 3x3 same conv2d… (#2846). Thanks, @axinging.
- ensure isMobile() does not fail when navigator is not set. [ensure isMobile() does not fail when navigator is not set] (#3075).
- [core] Fix toPixels memLeak for TensorLike inputs. (#3073).
- Remove duplicate declaration. [Remove duplicate declaration.] (#3030).
Development
- Add license to pad3d.ts. [Add license.] (#3027).
- Modularize max. (#2955).
- Modularize lrn. [Modularize lrn.] (#3218).
- Modularize sub. (#3021).
- Modularize matmul. [Modularize matmul.] (#3223).
- Modularize diag. [Modularize diag.] (#3217).
- Modularize conv ops. [[core] Modularize conv ops.] (#3120).
- Nightly test fixes [Nightly test fixes] (#3208).
- Modularize greaterEqual. [Modularize greaterEqual.] (#3192).
- Modularize lessEqual. [Modularize lessEqual.] (#3190).
- Modularize equal. [Modularize equal.] (#3189).
- Modularize less. [Modularize less.] (#3188).
- Fix browserstack iPhone browser issue. [Fix browserstack iPhone browser issue.] (#3204).
- Modularize greater. [Modularize greater.] (#3191).
- Modularize concat and split. [[core] Modularize concat and split.] (#3093).
- Remove use of chained ops. [Remove use of chained ops.] (#3058).
- Modularize notEqual. [[core]Modularize notEqual.] (#3091).
- update yarn.lock (#3090).
- fix nightly test for isMobile. [fix nightly test for isMobile] (#3079).
- Remove backward func from SquaredDifference. [Clean up. Remove backward func from SquaredDifference.] (#3055).
- Add this.throwIfDisposed() to modularized ops. [Add this.throwIfDisposed();] (#3044).
Misc
- deprecate strict variants of ops (#3239).
Data (1.7.4 ==> 2.0.0-rc.4)
Features
- [core] Modularize max. (#2955).
Breaking changes
- remove deprecation (#3233).
- Update packages to compile to ESM modules by default (#3112).
- Move cpu backend out of tfjs-core (#3008).
Development
Misc
- Update tfjs-data to 2.0.0-rc.4. (#3254).
- Fix webgl bundling and test invocation
- Remove unnecessary integration tests in node and node-gpu. (#3094).
Layers (1.7.4 ==> 2.0.0-rc.4)
Features
- [core] Modularize max. (#2955).
Breaking changes
- Remove deprecated batchnormalization op (#3238).
- Update packages to compile to ESM modules by default (#3112).
- move webgl backend out of core (#3056).
- Move cpu backend out of tfjs-core (#3008).
Converter (1.7.4 ==> 2.0.0-rc.4)
Features
- added support select v2 op (#3154).
Breaking changes
- Update packages to compile to ESM modules by default (#3112).
- Move cpu backend out of tfjs-core (#3008).
Bug fixes
- allow tfjs to dep on tf-cpu latest version (#3240).
- fix tensor array gather not be able to handle indices longer than available tensors (#3157).
- remove unnecessary eager call (#3145).
Misc
- Switching to tf.io. for file access and loading savedmodels in eager model. (#3126). Thanks, @davidzats-eng.
Node (1.7.4 ==> 2.0.0-rc.4)
Features
- Add support for napi version 6. [Add support for napi version 6] (#3242).
Breaking changes
- Remove deprecated batchnormalization op (#3238).
- [node] Remove deprecated createTypeOpAttr (#3235).
- Update packages to compile to ESM modules by default (#3112).
Bug fixes
- Fix node and nodegpu build. (#3248).
Development
- Modularize conv ops. [[core] Modularize conv ops.] (#3120).
- Remove cpu backend in tfjs-node testing, use fake instead. [Remove cpu backend in tfjs-node testing, use fake instead.] (#3082).
Documentation
- correct typo on tf.node.tensorBoard doc (#3243). Thanks, @avindra.
- fix import in README.md (#3201). Thanks, @qwertyforce.
Misc
- Remove layers symlink in node-gpu. (#3031).
Wasm (1.7.4 ==> 2.0.0-rc.4)
Features
- [core] Modularize max. (#2955).
- [wasm] Add split, sqrt kernels. (#3183).
- use instantiateWasm override and platform fetch (#3100).
Breaking changes
- Update packages to compile to ESM modules by default (#3112).
Bug fixes
- [wasm] Enable compatibility with emscripten 1.39.11, which in t… (#3108).
Development
- Modularize conv ops. [[core] Modularize conv ops.] (#3120).