Skip to content

Commit

Permalink
Merge pull request #49653 from geetachavan1/cherrypicks_UE6M7
Browse files Browse the repository at this point in the history
Add missing validations to reverse_sequence_op
  • Loading branch information
mihaimaruseac committed May 26, 2021
2 parents bf796c4 + c42d04b commit 0f90ce8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/core/kernels/reverse_sequence_op.cc
Expand Up @@ -115,6 +115,10 @@ class ReverseSequenceOp : public OpKernel {
: OpKernel(context) {
OP_REQUIRES_OK(context, context->GetAttr("batch_dim", &batch_dim_));
OP_REQUIRES_OK(context, context->GetAttr("seq_dim", &seq_dim_));
OP_REQUIRES(context, batch_dim_ >= 0,
errors::InvalidArgument("Invalid batch_dim ", batch_dim_));
OP_REQUIRES(context, seq_dim_ >= 0,
errors::InvalidArgument("Invalid seq_dim ", seq_dim_));
}

void Compute(OpKernelContext* context) override {
Expand Down

0 comments on commit 0f90ce8

Please sign in to comment.