-
Notifications
You must be signed in to change notification settings - Fork 617
Directory Structure #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
seanpmorgan
merged 8 commits into
tensorflow:master
from
seanpmorgan:directory-structure
Jan 10, 2019
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2b00424
Directory structure for discussion
seanpmorgan 3ff8309
Re-org directory structure
seanpmorgan f7f2381
Modify tests for TF2
seanpmorgan eac36b5
README update
seanpmorgan 0c2edc6
Minor fixes
seanpmorgan 76c957c
Set docker container as nightly custom-op
seanpmorgan 4779862
Wrappers doc fixes
seanpmorgan 199432b
Update tf dependency folder
seanpmorgan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # C extensions | ||
| *.so | ||
|
|
||
| # Distribution / packaging | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
|
|
||
| # Jupyter Notebook | ||
| .ipynb_checkpoints | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
|
|
||
| # Build | ||
| /.bazelrc | ||
| /bazel-* | ||
| /artifacts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| sh_binary( | ||
| name = "build_pip_pkg", | ||
| srcs = ["build_pip_pkg.sh"], | ||
| data = [ | ||
| "LICENSE", | ||
| "MANIFEST.in", | ||
| "setup.py", | ||
| "tensorflow_addons/__init__.py", | ||
| "//tensorflow_addons/layers:layers_py", | ||
| "//tensorflow_addons/text:text_py", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| Want to contribute? Great! First, read this page (including the small print at the end). | ||
|
|
||
| ### Before you contribute | ||
|
|
||
| Before we can use your code, you must sign the | ||
| [Google Individual Contributor License Agreement] | ||
| (https://cla.developers.google.com/about/google-individual) | ||
| (CLA), which you can do online. The CLA is necessary mainly because you own the | ||
| copyright to your changes, even after your contribution becomes part of our | ||
| codebase, so we need your permission to use and distribute your code. We also | ||
| need to be sure of various other things—for instance that you'll tell us if you | ||
| know that your code infringes on other people's patents. You don't have to sign | ||
| the CLA until after you've submitted your code for review and a member has | ||
| approved it, but you must do it before we can put your code into our codebase. | ||
| Before you start working on a larger contribution, you should get in touch with | ||
| us first through the issue tracker with your idea so that we can help out and | ||
| possibly guide you. Coordinating up front makes it much easier to avoid | ||
| frustration later on. | ||
|
|
||
| ### Code reviews | ||
|
|
||
| All submissions, including submissions by project members, require review. We | ||
| use Github pull requests for this purpose. | ||
|
|
||
| ### The small print | ||
|
|
||
| Contributions made by corporations are covered by a different agreement than | ||
| the one above, the | ||
| [Software Grant and Corporate Contributor License Agreement] | ||
| (https://cla.developers.google.com/about/google-corporate). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| recursive-include tensorflow_addons/ *.so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| load("//tf_dependency:tf_configure.bzl", "tf_configure") | ||
|
|
||
| tf_configure( | ||
| name = "local_config_tf", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #!/usr/bin/env bash | ||
| # Copyright 2019 The TensorFlow Authors. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # ============================================================================== | ||
| set -e | ||
| set -x | ||
|
|
||
| PLATFORM="$(uname -s | tr 'A-Z' 'a-z')" | ||
|
|
||
| PIP_FILE_PREFIX="bazel-bin/build_pip_pkg.runfiles/__main__/" | ||
|
|
||
| function main() { | ||
| while [[ ! -z "${1}" ]]; do | ||
| if [[ ${1} == "make" ]]; then | ||
| echo "Using Makefile to build pip package." | ||
| PIP_FILE_PREFIX="" | ||
| else | ||
| DEST=${1} | ||
| fi | ||
| shift | ||
| done | ||
|
|
||
| if [[ -z ${DEST} ]]; then | ||
| echo "No destination dir provided" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Create the directory, then do dirname on a non-existent file inside it to | ||
| # give us an absolute paths with tilde characters resolved to the destination | ||
| # directory. | ||
| mkdir -p ${DEST} | ||
| DEST=$(readlink -f "${DEST}") | ||
| echo "=== destination directory: ${DEST}" | ||
|
|
||
| TMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX) | ||
|
|
||
| echo $(date) : "=== Using tmpdir: ${TMPDIR}" | ||
|
|
||
| echo "=== Copy TensorFlow Addons files" | ||
|
|
||
| cp ${PIP_FILE_PREFIX}setup.py "${TMPDIR}" | ||
| cp ${PIP_FILE_PREFIX}MANIFEST.in "${TMPDIR}" | ||
| cp ${PIP_FILE_PREFIX}LICENSE "${TMPDIR}" | ||
| rsync -avm -L --exclude='*_test.py' ${PIP_FILE_PREFIX}tensorflow_addons "${TMPDIR}" | ||
|
|
||
| pushd ${TMPDIR} | ||
| echo $(date) : "=== Building wheel" | ||
|
|
||
| python setup.py bdist_wheel > /dev/null | ||
|
|
||
| cp dist/*.whl "${DEST}" | ||
| popd | ||
| rm -rf ${TMPDIR} | ||
| echo $(date) : "=== Output wheel file is in: ${DEST}" | ||
| } | ||
|
|
||
| main "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #!/bin/bash | ||
| # Copyright 2019 The TensorFlow Authors. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # ============================================================================== | ||
| function write_to_bazelrc() { | ||
| echo "$1" >> .bazelrc | ||
| } | ||
|
|
||
| function write_action_env_to_bazelrc() { | ||
| write_to_bazelrc "build --action_env $1=\"$2\"" | ||
| } | ||
|
|
||
| rm .bazelrc | ||
| if python -c "import tensorflow" &> /dev/null; then | ||
| echo 'using installed tensorflow' | ||
| else | ||
| pip install tf-nightly-2.0-preview | ||
| fi | ||
|
|
||
| TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') ) | ||
| TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') ) | ||
|
|
||
| write_action_env_to_bazelrc "TF_HEADER_DIR" ${TF_CFLAGS:2} | ||
| write_action_env_to_bazelrc "TF_SHARED_LIBRARY_DIR" ${TF_LFLAGS:2} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Copyright 2019 The TensorFlow Authors. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # ============================================================================== | ||
| """Setup for pip package.""" | ||
| from __future__ import absolute_import | ||
| from __future__ import division | ||
| from __future__ import print_function | ||
|
|
||
| from setuptools import find_packages | ||
| from setuptools import setup | ||
| from setuptools.dist import Distribution | ||
|
|
||
| __version__ = '0.0.1' | ||
| REQUIRED_PACKAGES = [ | ||
| 'tf-nightly-2.0-preview', | ||
| ] | ||
| project_name = 'tensorflow-addons' | ||
|
|
||
|
|
||
| class BinaryDistribution(Distribution): | ||
| """This class is needed in order to create OS specific wheels.""" | ||
|
|
||
| def has_ext_modules(self): | ||
| return True | ||
|
|
||
|
|
||
| setup( | ||
| name=project_name, | ||
| version=__version__, | ||
| description=('TensorFlow Addons'), | ||
| author='Google Inc.', | ||
| author_email='[email protected]', | ||
| packages=find_packages(), | ||
| install_requires=REQUIRED_PACKAGES, | ||
| include_package_data=True, | ||
| zip_safe=False, | ||
| distclass=BinaryDistribution, | ||
| classifiers=[ | ||
| 'Development Status :: 4 - Beta', | ||
| 'Intended Audience :: Developers', | ||
| 'Intended Audience :: Education', | ||
| 'Intended Audience :: Science/Research', | ||
| 'License :: OSI Approved :: Apache Software License', | ||
| 'Programming Language :: Python :: 2.7', | ||
| 'Programming Language :: Python :: 3.4', | ||
| 'Programming Language :: Python :: 3.5', | ||
| 'Programming Language :: Python :: 3.6', | ||
| 'Topic :: Scientific/Engineering :: Mathematics', | ||
| 'Topic :: Software Development :: Libraries :: Python Modules', | ||
| 'Topic :: Software Development :: Libraries', | ||
| ], | ||
| license='Apache 2.0', | ||
| keywords='tensorflow addons machine learning', | ||
| ) |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| licenses(["notice"]) # Apache 2.0 | ||
|
|
||
| package(default_visibility = ["//visibility:public"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Addons - Conditional Random Fields (CRF) | ||
|
|
||
|
|
||
| ## Standard API | ||
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Copyright 2019 The TensorFlow Authors. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # ============================================================================== | ||
|
|
||
| # import tensorflow as tf | ||
| # import tensorflow_addons as tfa | ||
| # from tensorflow_addons.text import skip_gram_sample | ||
|
|
||
|
|
||
| # TODO: Build this out | ||
| if __name__ == "__main__": | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| licenses(["notice"]) # Apache 2.0 | ||
|
|
||
| package(default_visibility = ["//visibility:public"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Addons - Image | ||
|
|
||
|
|
||
| ## Standard API |
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| licenses(["notice"]) # Apache 2.0 | ||
|
|
||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| py_library( | ||
| name = "layers_py", | ||
| srcs = ([ | ||
| "__init__.py", | ||
| "python/__init__.py", | ||
| "python/wrappers.py", | ||
| ]), | ||
| srcs_version = "PY2AND3", | ||
| ) | ||
|
|
||
| py_test( | ||
| name = "layers_wrappers_py_test", | ||
| srcs = [ | ||
| "python/wrappers_test.py", | ||
| ], | ||
| main = "python/wrappers_test.py", | ||
| deps = [ | ||
| ":layers_py", | ||
| ], | ||
| srcs_version = "PY2AND3", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Addons - Layers | ||
|
|
||
|
|
||
| ## Standard API | ||
| In order to conform with the current API standard, all layers | ||
| must inherit from either `keras.layers.Layer` or its subclasses. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github isn't making it easy to comment on empty files, so commenting here: if we don't need the python subdirs here (ie, crf/python/init.py), might be easier/clearer to remove throughout? Unless you feel it is helpful to have python/ versus cc/ for ops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO I like the separation between python vs. cc, but am open to removing it. As far as the entirely empty dirs (like crf), the init is just there so the directory structure can be checked into git.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM