Merge pull request #22822 from Intel-tensorflow:slice_bug_fix
PiperOrigin-RevId: 216734498
diff --git a/tensorflow/core/kernels/mkl_slice_op.cc b/tensorflow/core/kernels/mkl_slice_op.cc
index d63e14a..85cabeb 100644
--- a/tensorflow/core/kernels/mkl_slice_op.cc
+++ b/tensorflow/core/kernels/mkl_slice_op.cc
@@ -327,7 +327,7 @@
output_mkl_shape->SetTfLayout(input_mkl_shape.GetDimension(), output_dims,
input_mkl_shape.GetTfDataFormat());
- output_tf_shape.AddDim((output_pd->get_size() / sizeof(T)) + 1);
+ output_tf_shape.AddDim(output_pd->get_size() / sizeof(T));
} else {
// If input is not in Mkl layout, then output won't be in Mkl layout.
output_mkl_shape->SetMklTensor(false);