message: Fixed model server crash:
  Instead of calling the constructor of TensorShape, we call the BuildTensorShapeBase factory function and check the status of the calls in sparse_slice_op.
diff: @@ -18,6 +18,7 @@ limitations under the License.
  #include <vector>
  #include "tensorflow/core/framework/op_kernel.h"
  #include "tensorflow/core/framework/register_types.h"
  +#include "tensorflow/core/framework/tensor_shape.h"
  #include "tensorflow/core/util/sparse/sparse_tensor.h"
  namespace tensorflow {
  @@ -67,10 +68,13 @@ class SparseSliceOp : public OpKernel {
  " but got length ", input_size.NumElements()));
  sparse::SparseTensor sparse_tensor;
  + TensorShape sparse_tensor_shape;
  OP_REQUIRES_OK(context,
  - sparse::SparseTensor::Create(
  + TensorShapeBase<TensorShape>::BuildTensorShapeBase(
  + input_shape.vec<int64>(), &sparse_tensor_shape));
  + OP_REQUIRES_OK(context, sparse::SparseTensor::Create(
  input_indices, input_values,
  - TensorShape(input_shape.vec<int64>()), &sparse_tensor));
  + sparse_tensor_shape, &sparse_tensor));
  const gtl::ArraySlice<int64> start(input_start.flat<int64>().data(),
  input_dims);
  @@ -83,11 +87,17 @@ class SparseSliceOp : public OpKernel {
  context->set_output(0, output.indices());
  context->set_output(1, output.values());
  - const TensorShape output_shape(output.shape());
  + TensorShape output_shape;
  + OP_REQUIRES_OK(context, TensorShapeBase<TensorShape>::BuildTensorShapeBase(
  + output.shape(), &output_shape));
  +
  + TensorShape allocated_shape;
  + OP_REQUIRES_OK(context, TensorShapeBase<TensorShape>::BuildTensorShapeBase(
  + {output_shape.dims()}, &allocated_shape));
  Tensor* shape = nullptr;
  OP_REQUIRES_OK(context,
  - context->allocate_output(2, {output_shape.dims()}, &shape));
  + context->allocate_output(2, allocated_shape, &shape));
  for (int dim = 0; dim < output_shape.dims(); ++dim) {
  shape->vec<int64>()(dim) = output_shape.dim_size(dim);
  }
  