Skip to content

Commit d722a35

Browse files
Johannes Ballécopybara-github
authored andcommitted
Simplifications to build system.
PiperOrigin-RevId: 348102676 Change-Id: Icd43dceb63297c2eeff07cbae2d7b973b33dae3a
1 parent bcc8f46 commit d722a35

File tree

15 files changed

+28
-195
lines changed

15 files changed

+28
-195
lines changed

BUILD

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,37 @@ exports_files(["LICENSE"])
44

55
py_library(
66
name = "tensorflow_compression",
7-
srcs = [
8-
"tensorflow_compression/__init__.py",
9-
"tensorflow_compression/python/__init__.py",
10-
],
7+
srcs = ["tensorflow_compression/__init__.py"],
118
srcs_version = "PY3",
129
visibility = ["//visibility:public"],
1310
deps = [
14-
"//tensorflow_compression/python/distributions",
15-
"//tensorflow_compression/python/entropy_models",
16-
"//tensorflow_compression/python/layers",
17-
"//tensorflow_compression/python/ops",
18-
"//tensorflow_compression/python/util",
11+
"//tensorflow_compression/python/distributions:deep_factorized",
12+
"//tensorflow_compression/python/distributions:helpers",
13+
"//tensorflow_compression/python/distributions:round_adapters",
14+
"//tensorflow_compression/python/distributions:uniform_noise",
15+
"//tensorflow_compression/python/entropy_models:continuous_batched",
16+
"//tensorflow_compression/python/entropy_models:continuous_indexed",
17+
"//tensorflow_compression/python/entropy_models:universal",
18+
"//tensorflow_compression/python/layers:entropy_models",
19+
"//tensorflow_compression/python/layers:gdn",
20+
"//tensorflow_compression/python/layers:initializers",
21+
"//tensorflow_compression/python/layers:parameterizers",
22+
"//tensorflow_compression/python/layers:signal_conv",
23+
"//tensorflow_compression/python/layers:soft_round",
24+
"//tensorflow_compression/python/ops:math_ops",
25+
"//tensorflow_compression/python/ops:padding_ops",
26+
"//tensorflow_compression/python/ops:range_coding_ops",
27+
"//tensorflow_compression/python/ops:soft_round_ops",
28+
"//tensorflow_compression/python/ops:spectral_ops",
29+
"//tensorflow_compression/python/util:packed_tensors",
1930
],
2031
)
2132

2233
filegroup(
2334
name = "pip_src",
2435
srcs = [
2536
"MANIFEST.in",
26-
"tensorflow_compression/python/all_test.py",
37+
"tensorflow_compression/all_tests.py",
2738
],
2839
)
2940

@@ -44,38 +55,3 @@ py_binary(
4455
],
4556
python_version = "PY3",
4657
)
47-
48-
py_binary(
49-
name = "generate_docs",
50-
srcs = ["tools/generate_docs.py"],
51-
python_version = "PY3",
52-
deps = [":tensorflow_compression"],
53-
)
54-
55-
py_binary(
56-
name = "tfci",
57-
srcs = ["models/tfci.py"],
58-
python_version = "PY3",
59-
deps = [":tensorflow_compression"],
60-
)
61-
62-
py_binary(
63-
name = "bls2017",
64-
srcs = ["models/bls2017.py"],
65-
python_version = "PY3",
66-
deps = [":tensorflow_compression"],
67-
)
68-
69-
py_binary(
70-
name = "bmshj2018",
71-
srcs = ["models/bmshj2018.py"],
72-
python_version = "PY3",
73-
deps = [":tensorflow_compression"],
74-
)
75-
76-
py_binary(
77-
name = "ms2020",
78-
srcs = ["models/ms2020.py"],
79-
python_version = "PY3",
80-
deps = [":tensorflow_compression"],
81-
)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ interpreter would attempt to import `tensorflow_compression` packages from the
232232
source tree, rather than from the installed package system directory):
233233
```bash
234234
pushd /tmp
235-
python -m tensorflow_compression.python.all_test
235+
python -m tensorflow_compression.all_tests
236236
popd
237237
```
238238

tensorflow_compression/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,23 @@
2727
from tensorflow_compression.python.distributions.helpers import *
2828
from tensorflow_compression.python.distributions.round_adapters import *
2929
from tensorflow_compression.python.distributions.uniform_noise import *
30+
3031
from tensorflow_compression.python.entropy_models.continuous_batched import *
3132
from tensorflow_compression.python.entropy_models.continuous_indexed import *
3233
from tensorflow_compression.python.entropy_models.universal import *
34+
3335
from tensorflow_compression.python.layers.entropy_models import *
3436
from tensorflow_compression.python.layers.gdn import *
3537
from tensorflow_compression.python.layers.initializers import *
3638
from tensorflow_compression.python.layers.parameterizers import *
3739
from tensorflow_compression.python.layers.signal_conv import *
3840
from tensorflow_compression.python.layers.soft_round import *
41+
3942
from tensorflow_compression.python.ops.math_ops import *
4043
from tensorflow_compression.python.ops.padding_ops import *
4144
from tensorflow_compression.python.ops.range_coding_ops import *
4245
from tensorflow_compression.python.ops.soft_round_ops import *
4346
from tensorflow_compression.python.ops.spectral_ops import *
44-
from tensorflow_compression.python.util.packed_tensors import *
4547

48+
from tensorflow_compression.python.util.packed_tensors import *
4649
# pylint: enable=wildcard-import

tensorflow_compression/python/all_test.py renamed to tensorflow_compression/all_tests.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
# ==============================================================================
15-
"""Tests for tensorflow_compression/python.
15+
"""All Python tests for tensorflow_compression.
1616
17-
This is a convenience file to be included in PIP package.
18-
No BUILD entry exists for this file on purpose.
17+
This is a convenience file to be included in the pip package.
1918
"""
2019

2120
import tensorflow.compat.v1 as tf

tensorflow_compression/python/__init__.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

tensorflow_compression/python/distributions/BUILD

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ package(
44

55
licenses(["notice"]) # Apache 2.0
66

7-
py_library(
8-
name = "distributions",
9-
srcs = ["__init__.py"],
10-
srcs_version = "PY3",
11-
deps = [
12-
":deep_factorized",
13-
":helpers",
14-
":round_adapters",
15-
":uniform_noise",
16-
],
17-
)
18-
197
py_library(
208
name = "deep_factorized",
219
srcs = ["deep_factorized.py"],

tensorflow_compression/python/distributions/__init__.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

tensorflow_compression/python/entropy_models/BUILD

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ package(
44

55
licenses(["notice"]) # Apache 2.0
66

7-
py_library(
8-
name = "entropy_models",
9-
srcs = ["__init__.py"],
10-
srcs_version = "PY3",
11-
deps = [
12-
":continuous_base",
13-
":continuous_batched",
14-
":continuous_indexed",
15-
":universal",
16-
],
17-
)
18-
197
py_library(
208
name = "continuous_base",
219
srcs = ["continuous_base.py"],

tensorflow_compression/python/entropy_models/__init__.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

tensorflow_compression/python/layers/BUILD

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@ package(
44

55
licenses(["notice"]) # Apache 2.0
66

7-
py_library(
8-
name = "layers",
9-
srcs = ["__init__.py"],
10-
srcs_version = "PY3",
11-
deps = [
12-
":entropy_models",
13-
":gdn",
14-
":initializers",
15-
":parameterizers",
16-
":signal_conv",
17-
":soft_round",
18-
],
19-
)
20-
217
py_library(
228
name = "entropy_models",
239
srcs = ["entropy_models.py"],
@@ -46,7 +32,6 @@ py_library(
4632
name = "initializers",
4733
srcs = ["initializers.py"],
4834
srcs_version = "PY3",
49-
visibility = ["//visibility:private"],
5035
)
5136

5237
py_library(

0 commit comments

Comments
 (0)