aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util/sparse/group_iterator.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <nobody@tensorflow.org>2016-04-14 14:24:46 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-04-14 15:32:56 -0700
commitfd535e00fce5963f066b60b4a1e8822d4be92793 (patch)
tree255a0467b7234ad7ead9a6d106689b2b4bcd4c36 /tensorflow/core/util/sparse/group_iterator.cc
parente735c7903ada4651c4d4db2b5fb26f63c7dd65e6 (diff)
Add shape and order asserts in SparseTensor constructor.
Add const to SparseTensor.group. Overload == on GroupIterable.IteratorStep. Change: 119897767
Diffstat (limited to 'tensorflow/core/util/sparse/group_iterator.cc')
-rw-r--r--tensorflow/core/util/sparse/group_iterator.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/core/util/sparse/group_iterator.cc b/tensorflow/core/util/sparse/group_iterator.cc
index 9922e94f1d..73374adbf6 100644
--- a/tensorflow/core/util/sparse/group_iterator.cc
+++ b/tensorflow/core/util/sparse/group_iterator.cc
@@ -33,6 +33,11 @@ bool GroupIterable::IteratorStep::operator!=(const IteratorStep& rhs) const {
return (rhs.loc_ != loc_);
}
+bool GroupIterable::IteratorStep::operator==(const IteratorStep& rhs) const {
+ CHECK_EQ(rhs.iter_, iter_) << "Can't compare steps from different iterators";
+ return (rhs.loc_ == loc_);
+}
+
GroupIterable::IteratorStep& GroupIterable::IteratorStep::
operator++() { // prefix ++
loc_ = next_loc_;