-
Notifications
You must be signed in to change notification settings - Fork 74k
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
Add KinesisDataset support for tensorflow Dataset #19712
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e2d28f2
Add KinesisDataset support for tensorflow Dataset
yongtang 683f696
Expose KinesisDataset in dataset_ops.cc
yongtang f63ae63
Expose KinesisDataset in python wrapper
yongtang d693a3c
Add test cases for KinesisDataset
yongtang 80a726a
Update AWS library include files
yongtang e63ccb3
Add Bazel BUILD files
yongtang 80ec6b5
Rename s3_crypto to aws_crypto
yongtang 9eb844d
Rename with_s3_support to with_aws_support
yongtang da49885
Selectively add kinesis to tensorflow/contrib/BUILD
yongtang 21f9294
Set different partition key and pylint fix.
yongtang ca05f18
Add missing modules in cmake's python_modules.txt
yongtang 9d119a1
Address review feedback
yongtang File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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 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 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 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,113 @@ | ||
package(default_visibility = ["//tensorflow:internal"]) | ||
|
||
licenses(["notice"]) # Apache 2.0 | ||
|
||
exports_files(["LICENSE"]) | ||
|
||
load( | ||
"//tensorflow:tensorflow.bzl", | ||
"tf_custom_op_library", | ||
"tf_custom_op_py_library", | ||
"tf_gen_op_libs", | ||
"tf_gen_op_wrapper_py", | ||
"tf_kernel_library", | ||
"tf_py_test", | ||
) | ||
|
||
py_library( | ||
name = "kinesis", | ||
srcs = ["__init__.py"], | ||
srcs_version = "PY2AND3", | ||
deps = [ | ||
":dataset_ops", | ||
], | ||
) | ||
|
||
tf_custom_op_library( | ||
name = "_dataset_ops.so", | ||
srcs = ["ops/dataset_ops.cc"], | ||
deps = [":dataset_kernels"], | ||
) | ||
|
||
tf_gen_op_libs( | ||
op_lib_names = ["dataset_ops"], | ||
) | ||
|
||
cc_library( | ||
name = "dataset_kernels", | ||
srcs = [ | ||
"kernels/kinesis_dataset_ops.cc", | ||
], | ||
deps = [ | ||
"//tensorflow/core:framework_headers_lib", | ||
"//tensorflow/core/platform/s3:aws_crypto", | ||
"//third_party/eigen3", | ||
"@aws", | ||
"@protobuf_archive//:protobuf_headers", | ||
], | ||
alwayslink = 1, | ||
) | ||
|
||
py_library( | ||
name = "dataset_ops", | ||
srcs = [ | ||
"python/ops/kinesis_dataset_ops.py", | ||
], | ||
srcs_version = "PY2AND3", | ||
deps = [ | ||
":kinesis_op_loader", | ||
"//tensorflow/python:dataset_ops_gen", | ||
"//tensorflow/python:util", | ||
"//tensorflow/python/data/ops:dataset_ops", | ||
"//tensorflow/python/data/util:nest", | ||
], | ||
) | ||
|
||
tf_gen_op_wrapper_py( | ||
name = "gen_dataset_ops", | ||
out = "python/ops/gen_dataset_ops.py", | ||
deps = ["//tensorflow/contrib/kinesis:dataset_ops_op_lib"], | ||
) | ||
|
||
tf_kernel_library( | ||
name = "dataset_ops_kernels", | ||
deps = [ | ||
":dataset_kernels", | ||
"//tensorflow/core:framework", | ||
], | ||
alwayslink = 1, | ||
) | ||
|
||
tf_custom_op_py_library( | ||
name = "kinesis_op_loader", | ||
srcs = ["python/ops/kinesis_op_loader.py"], | ||
dso = ["//tensorflow/contrib/kinesis:_dataset_ops.so"], | ||
kernels = [ | ||
":dataset_ops_kernels", | ||
"//tensorflow/contrib/kinesis:dataset_ops_op_lib", | ||
], | ||
srcs_version = "PY2AND3", | ||
deps = [ | ||
":gen_dataset_ops", | ||
"//tensorflow/contrib/util:util_py", | ||
"//tensorflow/python:platform", | ||
], | ||
) | ||
|
||
tf_py_test( | ||
name = "kinesis_test", | ||
srcs = ["python/kernel_tests/kinesis_test.py"], | ||
additional_deps = [ | ||
":kinesis", | ||
"//third_party/py/numpy", | ||
"//tensorflow/python:client_testlib", | ||
"//tensorflow/python:framework", | ||
"//tensorflow/python:framework_test_lib", | ||
"//tensorflow/python:platform_test", | ||
], | ||
tags = [ | ||
"manual", | ||
"no_windows", | ||
"notap", | ||
], | ||
) |
This file contains 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,32 @@ | ||
# Copyright 2018 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. | ||
# ============================================================================== | ||
"""Kinesis Dataset. | ||
|
||
@@KinesisDataset | ||
""" | ||
|
||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
|
||
from tensorflow.contrib.kinesis.python.ops.kinesis_dataset_ops import KinesisDataset | ||
|
||
from tensorflow.python.util.all_util import remove_undocumented | ||
|
||
_allowed_symbols = [ | ||
"KinesisDataset", | ||
] | ||
|
||
remove_undocumented(__name__) |
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.
Is the
TF_NEED_S3
option documented anywhere, and if so can you please update it?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.
@mrry I searched through but couldn't find documentation related.