aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/sparse_softmax_op.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/kernels/sparse_softmax_op.cc')
-rw-r--r--tensorflow/core/kernels/sparse_softmax_op.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/tensorflow/core/kernels/sparse_softmax_op.cc b/tensorflow/core/kernels/sparse_softmax_op.cc
index 444a5f657a..dc3119bba4 100644
--- a/tensorflow/core/kernels/sparse_softmax_op.cc
+++ b/tensorflow/core/kernels/sparse_softmax_op.cc
@@ -69,8 +69,11 @@ class SparseSoftmaxOp : public OpKernel {
const int nnz = static_cast<int>(indices_t->dim_size(0));
const int rank = static_cast<int>(indices_t->dim_size(1));
- SparseTensor st(tensor::DeepCopy(*indices_t), tensor::DeepCopy(*values_t),
- TensorShape(shape_t->flat<int64>()));
+ SparseTensor st;
+ OP_REQUIRES_OK(
+ context, SparseTensor::Create(
+ tensor::DeepCopy(*indices_t), tensor::DeepCopy(*values_t),
+ TensorShape(shape_t->flat<int64>()), &st));
Tensor *output_values = nullptr;
OP_REQUIRES_OK(context, context->allocate_output(0, TensorShape({nnz}),