From 058df02be3e068f7e94b2893a78d503903878e17 Mon Sep 17 00:00:00 2001 From: Dayananda-V Date: Wed, 13 Feb 2019 12:20:22 +0530 Subject: [PATCH] TF Remove the limitation of int max for dim_size in SparseSoftmax ops This fix tries to address the simmiliat issue raised in #25701 where the dim_size in SparseSoftmax ops was set to . The restriction is likely unnecessary, due to historical reasons. This fix remove this limitation. --- tensorflow/core/kernels/sparse_softmax_op.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tensorflow/core/kernels/sparse_softmax_op.cc b/tensorflow/core/kernels/sparse_softmax_op.cc index 37664fe8df8..548080b8b13 100644 --- a/tensorflow/core/kernels/sparse_softmax_op.cc +++ b/tensorflow/core/kernels/sparse_softmax_op.cc @@ -62,12 +62,8 @@ class SparseSoftmaxOp : public OpKernel { errors::InvalidArgument( "Input should have rank >= 2, but received shape: ", shape_t->SummarizeValue(3))); - OP_REQUIRES(context, - indices_t->dim_size(0) < std::numeric_limits::max(), - errors::InvalidArgument( - "Number of non-zero elements exceeds int32 range")); - const int nnz = static_cast(indices_t->dim_size(0)); + const int64 nnz = indices_t->dim_size(0); const int rank = static_cast(indices_t->dim_size(1)); SparseTensor st; OP_REQUIRES_OK(