Skip to content

Commit

Permalink
Add missing validations to reverse_sequence_op
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 372178683
Change-Id: Iac97ebab5b342f1262c77a7d9bcb4267b305ce5b
  • Loading branch information
mihaimaruseac authored and geetachavan1 committed May 25, 2021
1 parent fbf8709 commit c42d04b
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 c42d04b

Please sign in to comment.