Skip to content

Commit 776f923

Browse files
PraChetitalanchiao
authored andcommitted
Release tensor_encoding part of the project.
PiperOrigin-RevId: 247634243
1 parent 587cf94 commit 776f923

36 files changed

+8096
-0
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
absl-py~=0.7
22
numpy~=1.14
33
six~=1.10
4+
scipy
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Internal
2+
3+
The internal package contains a collection of modules that are documented,
4+
fully working, and there exists a plan to be graduated to the main `tf.mot`
5+
namespace -- either a literal swap of `tf.mot.internal.<module>` for
6+
`tf.mot.<module>`, or creation of separate public API that calls the internal
7+
API under the hood.
8+
9+
The `tf.mot.internal` modules can change in backwards incompatible manner. Thus,
10+
depending on these modules is not recommended.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
licenses(["notice"]) # Apache 2.0
4+
5+
py_library(
6+
name = "tensor_encoding",
7+
srcs = ["__init__.py"],
8+
deps = [
9+
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/core",
10+
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/encoders",
11+
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/stages",
12+
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/utils",
13+
],
14+
)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2019, The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""The Tensor Encoding package."""
15+
16+
from __future__ import absolute_import
17+
from __future__ import division
18+
from __future__ import print_function
19+
20+
from tensorflow_model_optimization.python.core.internal.tensor_encoding import core
21+
from tensorflow_model_optimization.python.core.internal.tensor_encoding import encoders
22+
from tensorflow_model_optimization.python.core.internal.tensor_encoding import stages
23+
from tensorflow_model_optimization.python.core.internal.tensor_encoding import utils
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
package(default_visibility = [
2+
"//tensorflow_model_optimization/python/core/internal/tensor_encoding:__subpackages__",
3+
])
4+
5+
licenses(["notice"]) # Apache 2.0
6+
7+
py_library(
8+
name = "core",
9+
srcs = ["__init__.py"],
10+
visibility = ["//visibility:public"],
11+
deps = [
12+
":core_encoder",
13+
":encoding_stage",
14+
":simple_encoder",
15+
],
16+
)
17+
18+
py_library(
19+
name = "core_encoder",
20+
srcs = ["core_encoder.py"],
21+
deps = [
22+
":encoding_stage",
23+
# six dep1,
24+
# tensorflow dep1,
25+
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/utils:py_utils",
26+
],
27+
)
28+
29+
py_test(
30+
name = "core_encoder_test",
31+
size = "small",
32+
srcs = ["core_encoder_test.py"],
33+
deps = [
34+
":core_encoder",
35+
":encoding_stage",
36+
# numpy dep1,
37+
# tensorflow dep1,
38+
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/testing:test_utils",
39+
],
40+
)
41+
42+
py_library(
43+
name = "encoding_stage",
44+
srcs = ["encoding_stage.py"],
45+
deps = [
46+
# enum dep1,
47+
# six dep1,
48+
# tensorflow dep1,
49+
],
50+
)
51+
52+
py_test(
53+
name = "encoding_stage_test",
54+
size = "small",
55+
srcs = ["encoding_stage_test.py"],
56+
deps = [
57+
":encoding_stage",
58+
# absl/testing:parameterized dep1,
59+
# mock dep1,
60+
# numpy dep1,
61+
# tensorflow dep1,
62+
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/testing:test_utils",
63+
],
64+
)
65+
66+
py_library(
67+
name = "simple_encoder",
68+
srcs = ["simple_encoder.py"],
69+
deps = [
70+
":core_encoder",
71+
# tensorflow dep1,
72+
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/utils:py_utils",
73+
],
74+
)
75+
76+
py_test(
77+
name = "simple_encoder_test",
78+
size = "small",
79+
srcs = ["simple_encoder_test.py"],
80+
deps = [
81+
":core_encoder",
82+
":simple_encoder",
83+
# absl/testing:parameterized dep1,
84+
# numpy dep1,
85+
# tensorflow dep1,
86+
"//tensorflow_model_optimization/python/core/internal/tensor_encoding/testing:test_utils",
87+
],
88+
)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2019, The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Core parts of the `tensor_encoding` package."""
15+
16+
from __future__ import absolute_import
17+
from __future__ import division
18+
from __future__ import print_function
19+
20+
from tensorflow_model_optimization.python.core.internal.tensor_encoding.core.core_encoder import Encoder
21+
from tensorflow_model_optimization.python.core.internal.tensor_encoding.core.core_encoder import EncoderComposer
22+
23+
from tensorflow_model_optimization.python.core.internal.tensor_encoding.core.encoding_stage import AdaptiveEncodingStageInterface
24+
from tensorflow_model_optimization.python.core.internal.tensor_encoding.core.encoding_stage import EncodingStageInterface
25+
from tensorflow_model_optimization.python.core.internal.tensor_encoding.core.encoding_stage import StateAggregationMode
26+
from tensorflow_model_optimization.python.core.internal.tensor_encoding.core.encoding_stage import tf_style_adaptive_encoding_stage
27+
from tensorflow_model_optimization.python.core.internal.tensor_encoding.core.encoding_stage import tf_style_encoding_stage
28+
29+
from tensorflow_model_optimization.python.core.internal.tensor_encoding.core.simple_encoder import SimpleEncoder
30+
from tensorflow_model_optimization.python.core.internal.tensor_encoding.core.simple_encoder import StatefulSimpleEncoder

0 commit comments

Comments
 (0)