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(