Skip to content

Commit 0223769

Browse files
author
Nikhil Thorat
committed
Merge tfjs-converter into the monorepo.
2 parents 62f4b59 + d15065a commit 0223769

File tree

169 files changed

+41825
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+41825
-3
lines changed

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@
55
.idea/
66
.rpt2_cache/
77
.yalc/
8+
/compiled_api.js
89
bazel-out/
10+
bazel-*
911
coverage/
1012
dist/
1113
local.log
12-
package
13-
package-lock.json
14+
1415
node_modules/
1516
npm-debug.log
17+
package
18+
package-lock.json
1619
release-notes.md
1720
tensorflow-tfjs-*.tgz
1821
tfjs-backend-wasm/dist
1922
tfjs-backend-wasm/wasm-out
2023
yalc.lock
21-
yarn-error.log
24+
yarn-error.log

tfjs-converter/.babelrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"presets": [
3+
[
4+
"env",
5+
{
6+
"modules": false
7+
}
8+
]
9+
],
10+
"plugins": [
11+
"external-helpers"
12+
]
13+
}

tfjs-converter/.npmignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.babelrc
2+
.DS_Store
3+
.idea/
4+
.pylintrc
5+
.rpt2_cache
6+
.travis.yml
7+
.vscode
8+
*.tgz
9+
*.txt
10+
**.yalc
11+
**yalc.lock
12+
cloudbuild.yml
13+
coverage/
14+
demo/
15+
DEVELOPMENT.md
16+
dist/**/*_test.d.ts
17+
dist/**/*_test.js
18+
docs/
19+
ISSUE_TEMPLATE.md
20+
karma.conf.js
21+
node_modules/
22+
npm-debug.log
23+
package-lock.json
24+
package/
25+
python/
26+
rollup.config.google.js
27+
rollup.config.js
28+
scripts/
29+
src/**/*_test.ts
30+
test_results
31+
tsconfig.json
32+
tslint.json
33+
yarn-error.log
34+
yarn.lock
35+
.git

tfjs-converter/DEVELOPMENT.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Notes for TensorFlow.js-Converter Developers
2+
3+
## Python Development
4+
5+
There are some Python libraries, binary and tests in the `python/` directory.
6+
7+
It is recommended to do your Python development and testing in a
8+
[virtualenv](https://virtualenv.pypa.io/en/stable/) or
9+
[pipenv](https://docs.pipenv.org/).
10+
11+
As a prerequisite, install the following dependencies for python testing
12+
```sh
13+
cd python
14+
pip install -r requirements.txt
15+
```
16+
17+
For Python linter, install `pylint`, e.g.,
18+
* `apt-get install -y pylint`
19+
20+
To run the Python linter:
21+
```sh
22+
cd python
23+
pylint tensorflowjs
24+
```
25+
26+
To run the python unit tests, there are two options. You can choose the one that
27+
you prefer.
28+
29+
1. Run the tests using the `run-python-tests.sh` script:
30+
31+
```sh
32+
cd python
33+
./run-python-tests.sh
34+
```
35+
36+
2. Run the tests using Bazel. See bazel installation guide
37+
[here](https://docs.bazel.build/versions/master/install.html). Once bazel
38+
is installed, do:
39+
40+
```sh
41+
cd python
42+
bazel test tensorflowjs/...
43+
```
44+
45+
Be sure to run the tests under **both** Python 2 and Python 3.
46+
47+
### Building and testing the tensorflowjs pip package
48+
49+
```sh
50+
cd python
51+
52+
# You need to specify a folder where the pip wheel file will be stored, e.g.,
53+
./build-pip-package.sh /tmp/my_tensorflowjs_pip
54+
55+
# If the script succeeds, you can use `pip install` to install the pip package:
56+
57+
pip install --force-reinstall \
58+
/tmp/my_tensorflowjs_pip/tensorflowjs-0.0.1-py2-none-any.whl
59+
```
60+
61+
`build-pip-package.sh` provides a flag (`--test`) with which you can run a
62+
test-on-install after building the pip package. Make sure you are using a
63+
`virutalenv` or `pipenv` to avoid changing your base environmnet.
64+
65+
```sh
66+
./build-pip-package.sh --test /tmp/my_tensorflowjs_pip
67+
```

0 commit comments

Comments
 (0)