|
1 | 1 | ## Development
|
2 | 2 |
|
| 3 | +<<<<<<< HEAD |
3 | 4 | This repository contains only the logic and scripts that combine
|
4 | 5 | two packages:
|
5 | 6 | - [TensorFlow.js Core](https://github.com/tensorflow/tfjs-core),
|
@@ -73,3 +74,71 @@ This will show up under "Features" as:
|
73 | 74 |
|
74 | 75 | This will also show up under "Performance" as:
|
75 | 76 | - Improve matMul CPU speed by 100%. (Improvements to matMul.) (#900). Thanks, @externalcontributor.
|
| 77 | +======= |
| 78 | +To build **TensorFlow.js Core API** from source, we need to clone the project and prepare |
| 79 | +the dev environment: |
| 80 | + |
| 81 | +```bash |
| 82 | +$ git clone https://github.com/tensorflow/tfjs-core.git |
| 83 | +$ cd tfjs-core |
| 84 | +$ yarn # Installs dependencies. |
| 85 | +``` |
| 86 | + |
| 87 | +#### Yarn |
| 88 | +We use yarn, and if you are adding or removing dependencies you should use yarn |
| 89 | +to keep the `yarn.lock` file up to date. |
| 90 | + |
| 91 | +#### Code editor |
| 92 | +We recommend using [Visual Studio Code](https://code.visualstudio.com/) for |
| 93 | +development. Make sure to install |
| 94 | +[TSLint VSCode extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin) |
| 95 | +and the npm [clang-format](https://github.com/angular/clang-format) `1.2.2` or later |
| 96 | +with the |
| 97 | +[Clang-Format VSCode extension](https://marketplace.visualstudio.com/items?itemName=xaver.clang-format) |
| 98 | +for auto-formatting. |
| 99 | + |
| 100 | +#### Testing |
| 101 | +Before submitting a pull request, make sure the code passes all the tests and is clean of lint errors: |
| 102 | + |
| 103 | +```bash |
| 104 | +$ yarn test |
| 105 | +$ yarn lint |
| 106 | +``` |
| 107 | + |
| 108 | +To run a subset of tests and/or on a specific browser: |
| 109 | + |
| 110 | +```bash |
| 111 | +$ yarn test --browsers=Chrome --grep='multinomial' |
| 112 | + |
| 113 | +> ... |
| 114 | +> Chrome 62.0.3202 (Mac OS X 10.12.6): Executed 28 of 1891 (skipped 1863) SUCCESS (6.914 secs / 0.634 secs) |
| 115 | +``` |
| 116 | + |
| 117 | +To run the tests once and exit the karma process (helpful on Windows): |
| 118 | + |
| 119 | +```bash |
| 120 | +$ yarn test --single-run |
| 121 | +``` |
| 122 | + |
| 123 | +To run the tests in an environment that does not have GPU support (such as Chrome Remote Desktop): |
| 124 | + |
| 125 | +```bash |
| 126 | +$ yarn test --testEnv cpu |
| 127 | +``` |
| 128 | + |
| 129 | +Available test environments: cpu, webgl1, webgl2. |
| 130 | + |
| 131 | +#### Packaging (browser and npm) |
| 132 | + |
| 133 | +```bash |
| 134 | +$ yarn build-npm |
| 135 | +> Stored standalone library at dist/tf-core(.min).js |
| 136 | +> Stored also tensorflow-tf-core-VERSION.tgz |
| 137 | +``` |
| 138 | + |
| 139 | +To install it locally, run `yarn add ./tensorflow-tf-core-VERSION.tgz`. |
| 140 | + |
| 141 | +> On Windows, use bash (available through git) to use the scripts above. |
| 142 | +
|
| 143 | +Looking to contribute, and don't know where to start? Check out our "stat:contributions welcome" [issues](https://github.com/tensorflow/tfjs/labels/stat%3Acontributions%20welcome). |
| 144 | +>>>>>>> tfjs-core/master |
0 commit comments