diff options
author | 2016-06-24 17:28:59 -0800 | |
---|---|---|
committer | 2016-06-24 18:34:18 -0700 | |
commit | bdcab43420d30da8706e257c2da8c08743c39b0b (patch) | |
tree | c801a2c05517589bb6bdab6542d9f685fd1a5f24 /tensorflow/core/kernels/queue_base.cc | |
parent | 11e888153d13a23ca0532425a0a145307c438bf6 (diff) |
Add support for DequeueUpTo in FIFOQueue and PaddingFIFOQueue
Change: 125837171
Diffstat (limited to 'tensorflow/core/kernels/queue_base.cc')
-rw-r--r-- | tensorflow/core/kernels/queue_base.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/queue_base.cc b/tensorflow/core/kernels/queue_base.cc index df9ca6567e..753c6a6ce3 100644 --- a/tensorflow/core/kernels/queue_base.cc +++ b/tensorflow/core/kernels/queue_base.cc @@ -30,6 +30,7 @@ Status HandleSliceToElement(const Tensor& parent, Tensor* element, int64 index) { typedef typename EnumToDataType<DT>::Type T; DCHECK_NE(parent.dim_size(0), 0); + DCHECK_GE(index, 0); if (element->NumElements() != (parent.NumElements() / parent.dim_size(0))) { TensorShape chip_shape = parent.shape(); chip_shape.RemoveDim(0); @@ -48,6 +49,7 @@ template <DataType DT> Status HandleElementToSlice(const Tensor& element, Tensor* parent, int index) { typedef typename EnumToDataType<DT>::Type T; DCHECK_NE(parent->dim_size(0), 0); + DCHECK_GE(index, 0); if (element.NumElements() != (parent->NumElements() / parent->dim_size(0))) { TensorShape chip_shape = parent->shape(); chip_shape.RemoveDim(0); |