aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/framework/tensor.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-09-25 21:54:20 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-25 21:58:08 -0700
commitf2b17b22e12bd743b66945070f338f70b5fa3332 (patch)
treeb0d78ae134c6e241547970adedd078574a471920 /tensorflow/core/framework/tensor.cc
parent6666516f390f125ed70ddbd4e6f89b83d953c408 (diff)
Allow subslicing Tensors with a single dimension.
PiperOrigin-RevId: 214553359
Diffstat (limited to 'tensorflow/core/framework/tensor.cc')
-rw-r--r--tensorflow/core/framework/tensor.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/core/framework/tensor.cc b/tensorflow/core/framework/tensor.cc
index 3df677675e..1dea6da911 100644
--- a/tensorflow/core/framework/tensor.cc
+++ b/tensorflow/core/framework/tensor.cc
@@ -813,7 +813,7 @@ Tensor Tensor::Slice(int64 start, int64 limit) const {
}
Tensor Tensor::SubSlice(int64 index) const {
- CHECK_GE(dims(), 2); // Crash ok.
+ CHECK_GE(dims(), 1); // Crash ok.
CHECK_LE(0, index); // Crash ok.
int64 dim0_size = shape_.dim_size(0);
CHECK_LE(index, dim0_size); // Crash ok.