-
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 take_while experimental dataset op #24645
Conversation
Still need to add test cases, but any changes required in the current commits? @jsimsa @mrry Most other dataset op that take in a function as a parameter, check for short circuits using Also, right now |
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.
Overall, this looks promising. I left (mostly minor) comments throughout the PR.
As for your questions, 1) implementing the short-circuit path is optional and 2) take_while
should be stateless. If a user needs a stateful version, they can build that out of existing transformations (scan
+ take_while
+ map
).
tensorflow/core/kernels/data/experimental/take_while_dataset_op.cc
Outdated
Show resolved
Hide resolved
tensorflow/core/kernels/data/experimental/take_while_dataset_op.cc
Outdated
Show resolved
Hide resolved
tensorflow/core/kernels/data/experimental/take_while_dataset_op.cc
Outdated
Show resolved
Hide resolved
tensorflow/core/kernels/data/experimental/take_while_dataset_op.cc
Outdated
Show resolved
Hide resolved
Remove preserve_cardinality Update license year Propagate predicate's error to the caller Inline _transformation_name
I've made the required changes. Adding tests in the next couple of hours. |
@jsimsa I've added tests and made the changes mentioned. Take a look, and let me know if further changes are required. |
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.
Thanks @Squadrick. Left a couple more small comments. I am going to trigger presubmit tests which might require additional fixes.
tensorflow/core/kernels/data/experimental/take_while_dataset_op.cc
Outdated
Show resolved
Hide resolved
...python/data/experimental/kernel_tests/serialization/take_while_dataset_serialization_test.py
Outdated
Show resolved
Hide resolved
tensorflow/python/data/experimental/kernel_tests/take_while_test.py
Outdated
Show resolved
Hide resolved
tensorflow/python/data/experimental/kernel_tests/take_while_test.py
Outdated
Show resolved
Hide resolved
tensorflow/python/data/experimental/kernel_tests/take_while_test.py
Outdated
Show resolved
Hide resolved
@jsimsa Made the changes and fixed whatever was failing on the tests. I wasn't exactly sure what the api_def should look like for this, so I copied and edited Also, what's the difference between |
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.
a couple more minor comments
tensorflow/core/kernels/data/experimental/take_while_dataset_op.cc
Outdated
Show resolved
Hide resolved
tensorflow/core/kernels/data/experimental/take_while_dataset_op.cc
Outdated
Show resolved
Hide resolved
tensorflow/python/data/experimental/kernel_tests/take_while_test.py
Outdated
Show resolved
Hide resolved
`take_while` ShortCircuit tests are parameterized Fix errors in `BUILD` files using `buildifier` LoopIteratorPredicate takes `vector<Tensor>&`
@jsimsa Made the changes you asked and fixed whatever was causing the CI to fail. I think it should be good to go unless I've overlooked something. |
@Squadrick one of the test failures can you run the following:
and update the PR |
@jsimsa I pulled
I also got this warning:
And this seems to be the
I have no idea how to proceed. How do I go about getting API approval? |
The only file I will take care of the API approval (it happens during the internal review of the PR). |
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.
The internal review surfaced a couple of issues.
@jsimsa Running the update script didn't change any of the In Is there something I'm overlooking? |
…into take-while
@jsimsa Pushed the requested changes. |
@Squadrick thanks, I will resume the internal review. |
PiperOrigin-RevId: 229625006
Addresses #24105