Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix OOB issue with tf.raw_ops.SparseSparseMinimum.
PiperOrigin-RevId: 371005787
Change-Id: Ib686ccc077836e8b980b8b5a03936d36a8ecaf71
  • Loading branch information
Amit Patankar authored and tensorflower-gardener committed Apr 28, 2021
1 parent 2e69763 commit ba6822b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensorflow/core/kernels/sparse_sparse_binary_op_shared.cc
Expand Up @@ -180,6 +180,11 @@ class SparseSparseBinaryOpShared : public OpKernel {
" for dimension ", i));
}

OP_REQUIRES(
ctx, a_indices_t->dim_size(1) == b_indices_t->dim_size(1),
errors::InvalidArgument(
"Indices' dimensions do not match: got ", a_indices_t->dim_size(1),
" and ", b_indices_t->dim_size(1), " for the second dimension."));
const int num_dims = a_indices_t->dim_size(1);
const auto a_indices_mat = a_indices_t->matrix<int64>();
const auto b_indices_mat = b_indices_t->matrix<int64>();
Expand Down

0 comments on commit ba6822b

Please sign in to comment.