Skip to content
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

Fix FPE issue with tf.raw_ops.Reverse. #49548

Merged
merged 1 commit into from
May 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions tensorflow/core/kernels/reverse_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ class ReverseOp : public OpKernel {

void Compute(OpKernelContext* context) override {
const Tensor& input = context->input(0);
// If input is provided, check to make sure the first dimension is valid.
if (input.dims() > 0) {
OP_REQUIRES(
context, input.dim_size(0) != 0,
errors::InvalidArgument("Invalid input first dimension. Found 0."));
}
const Tensor& dims = context->input(1);

if (TensorShapeUtils::IsScalar(input.shape())) {
Expand Down