Skip to content

Commit f8b6bdf

Browse files
authored
Merge branch 'master' into philjd/decaoupled_weight_decay
2 parents 077924c + 4118a11 commit f8b6bdf

Some content is hidden

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

66 files changed

+2884
-1453
lines changed

.github/CODEOWNERS

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@
33
# SIG maintainers are the catch all for reviews
44
* @tensorflow/sig-addons-maintainers
55

6-
76
# Subpackage Owners
7+
/tensorflow_addons/activations/ @facaiy @seanpmorgan
8+
/tensorflow_addons/image/ @windqaq @facaiy
9+
/tensorflow_addons/layers/ @seanpmorgan @facaiy
10+
/tensorflow_addons/losses/ @facaiy @windqaq
11+
/tensorflow_addons/optimizers/ @facaiy @windqaq
12+
/tensorflow_addons/rnn/ @qlzh727
813
/tensorflow_addons/seq2seq/ @qlzh727
9-
/tensorflow_addons/custom_ops/seq2seq/ @qlzh727
14+
/tensorflow_addons/text/ @seanpmorgan @facaiy
1015

16+
/tensorflow_addons/custom_ops/image/ @windqaq @facaiy
17+
/tensorflow_addons/custom_ops/seq2seq/ @qlzh727
18+
/tensorflow_addons/custom_ops/text/ @seanpmorgan @facaiy
1119

1220
# Submodule Owners
1321
# These may not automatically trigger a review because submodule owners do not
@@ -17,7 +25,7 @@
1725
/tensorflow_addons/activations/sparsemax*.py @AndreasMadsen
1826
/tensorflow_addons/image/dense_image_warp*.py @WindQAQ
1927
/tensorflow_addons/image/distort_image_ops*.py @WindQAQ
20-
/tensorflow_addons/image/median_filter_2d*.py @Mainak431
28+
/tensorflow_addons/image/filters*.py @Mainak431
2129
/tensorflow_addons/layers/normalizations*.py @smokrow
2230
/tensorflow_addons/layers/sparsemax*.py @AndreasMadsen
2331
/tensorflow_addons/losses/contrastive*.py @WindQAQ

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ wheels/
3030
# IDE
3131
.vscode/
3232
.idea/
33+
*.iml
3334

3435
# Build
3536
/.bazelrc

BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ sh_binary(
1111
"//tensorflow_addons/layers",
1212
"//tensorflow_addons/losses",
1313
"//tensorflow_addons/optimizers",
14+
"//tensorflow_addons/rnn",
1415
"//tensorflow_addons/seq2seq",
1516
"//tensorflow_addons/text",
1617
],

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ developments that cannot be integrated into core TensorFlow
2929
## Maintainers
3030
| Subpackage | Maintainers | Contact Info |
3131
|:----------------------- |:----------- |:----------------------------|
32-
| [tfa.activations](tensorflow_addons/activations/README.md) | SIG-Addons | [email protected] |
33-
| [tfa.image](tensorflow_addons/image/README.md) | | |
34-
| [tfa.layers](tensorflow_addons/layers/README.md) | SIG-Addons | [email protected] |
35-
| [tfa.losses](tensorflow_addons/losses/README.md) | SIG-Addons | [email protected] |
36-
| [tfa.optimizers](tensorflow_addons/optimizers/README.md) | SIG-Addons | [email protected] |
37-
| [tfa.seq2seq](tensorflow_addons/seq2seq/README.md) | Google | @qlzh727 |
38-
| [tfa.text](tensorflow_addons/text/README.md) | | |
32+
| [tfa.activations](tensorflow_addons/activations/README.md) | SIG-Addons | @facaiy @seanpmorgan |
33+
| [tfa.image](tensorflow_addons/image/README.md) | SIG-Addons | @windqaq @facaiy |
34+
| [tfa.layers](tensorflow_addons/layers/README.md) | SIG-Addons | @seanpmorgan @facaiy |
35+
| [tfa.losses](tensorflow_addons/losses/README.md) | SIG-Addons | @facaiy @windqaq |
36+
| [tfa.optimizers](tensorflow_addons/optimizers/README.md) | SIG-Addons | @facaiy @windqaq |
37+
| [tfa.rnn](tensorflow_addons/rnn/README.md) | Google | @qlzh727 |
38+
| [tfa.seq2seq](tensorflow_addons/seq2seq/README.md) | Google | @qlzh727 |
39+
| [tfa.text](tensorflow_addons/text/README.md) | SIG-Addons | @seanpmorgan @facaiy |
3940

4041
## Core Concepts
4142

@@ -61,8 +62,8 @@ To install the latest version, run the following:
6162
```
6263
pip install tensorflow-addons
6364
```
64-
65-
**Note:** You will also need [TensorFlow 2.0 or higher](https://www.tensorflow.org/alpha).
65+
66+
**Note:** You will also need [`tensorflow==2.0.0.a0`](https://www.tensorflow.org/alpha) installed.
6667

6768
To use addons:
6869

@@ -75,6 +76,8 @@ import tensorflow_addons as tfa
7576
You can also install from source. This requires the [Bazel](
7677
https://bazel.build/) build system.
7778

79+
**Note:** If building from master you must install `tf-nightly-2.0-preview` in the process.
80+
7881
```
7982
git clone https://github.com/tensorflow/addons.git
8083
cd addons
@@ -88,8 +91,6 @@ bazel-bin/build_pip_pkg artifacts
8891
pip install artifacts/tensorflow_addons-*.whl
8992
```
9093

91-
**Notice**: If you are using Mac OS X, you need install addition software by `brew install coreutils` (this requires the [Homebrew](https://brew.sh/)) or `port install coreutils` (this requires the [MacPorts](https://www.macports.org/))
92-
9394
## Contributing
9495
TF-Addons is a community led open source project. As such, the project
9596
depends on public contributions, bug-fixes, and documentation. Please

STYLE_GUIDE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@ BAR = [
3737
# pylint: disable=protected-access
3838
foo._protected_member
3939
# pylint: enable=protected-access
40-
```
40+
```
41+
42+
43+
#### TensorFlow Conventions
44+
45+
Follow the guidance in the [TensorFlow Style Guide - Conventions](https://www.tensorflow.org/community/contribute/code_style#tensorflow_conventions_and_special_uses).

build_pip_pkg.sh

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,27 @@
1616
set -e
1717
set -x
1818

19-
PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
20-
2119
PIP_FILE_PREFIX="bazel-bin/build_pip_pkg.runfiles/__main__/"
2220

23-
if [[ ${PLATFORM} == "darwin" ]]; then
24-
READLINK="greadlink" # from pkg `coreutils` in brew/macports in Mac OS X
25-
else
26-
READLINK="readlink"
27-
fi
28-
21+
function abspath() {
22+
cd "$(dirname $1)"
23+
echo "$PWD/$(basename $1)"
24+
cd "$OLDPWD"
25+
}
2926

3027
function main() {
31-
while [[ ! -z "${1}" ]]; do
32-
if [[ ${1} == "make" ]]; then
33-
echo "Using Makefile to build pip package."
34-
PIP_FILE_PREFIX=""
35-
else
36-
DEST=${1}
37-
fi
38-
shift
39-
done
40-
28+
DEST=${1}
4129
if [[ -z ${DEST} ]]; then
4230
echo "No destination dir provided"
4331
exit 1
4432
fi
4533

46-
# Create the directory, then do dirname on a non-existent file inside it to
47-
# give us an absolute paths with tilde characters resolved to the destination
48-
# directory.
4934
mkdir -p ${DEST}
50-
DEST=$(${READLINK} -f "${DEST}")
35+
DEST=$(abspath "${DEST}")
5136
echo "=== destination directory: ${DEST}"
5237

5338
TMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX)
54-
5539
echo $(date) : "=== Using tmpdir: ${TMPDIR}"
56-
5740
echo "=== Copy TensorFlow Addons files"
5841

5942
cp ${PIP_FILE_PREFIX}setup.py "${TMPDIR}"

configure.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,17 @@ function write_action_env_to_bazelrc() {
3535
}
3636

3737
[[ -f .bazelrc ]] && rm .bazelrc
38+
read -r -p "Tensorflow will be upgraded to 2.0. Are You Sure? [Y/n] " reply
39+
case $reply in
40+
[yY]*) echo "Installing...";;
41+
* ) echo "Goodbye!"; exit;;
42+
esac
3843
pip install $QUIET_FLAG -r requirements.txt
3944

4045
TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') )
4146
TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') )
47+
TF_SHAREDLIB=( $(python -c 'import tensorflow as tf; print(tf.sysconfig.get_link_flags()[-1])') )
4248

4349
write_action_env_to_bazelrc "TF_HEADER_DIR" ${TF_CFLAGS:2}
4450
write_action_env_to_bazelrc "TF_SHARED_LIBRARY_DIR" ${TF_LFLAGS:2}
51+
write_action_env_to_bazelrc "TF_SHARED_LIBRARY_NAME" ${TF_SHAREDLIB:3}

tensorflow_addons/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def _ensure_tf_install():
7676
from tensorflow_addons import layers
7777
from tensorflow_addons import losses
7878
from tensorflow_addons import optimizers
79+
from tensorflow_addons import rnn
7980
from tensorflow_addons import seq2seq
8081
from tensorflow_addons import text
8182

tensorflow_addons/custom_ops/__init__.py

Whitespace-only changes.

tensorflow_addons/custom_ops/image/cc/kernels/euclidean_distance_transform_op.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class EuclideanDistanceTransformGenerator {
5252

5353
if (input_(coords) == T(0)) return T(0);
5454

55-
float minDistance = std::numeric_limits<T>::max();
55+
float minDistance = static_cast<float>(std::numeric_limits<T>::max());
5656

5757
for (int h = 0; h < height_; ++h) {
5858
for (int w = 0; w < width_; ++w) {

0 commit comments

Comments
 (0)