diff options
author | A. Unique TensorFlower <nobody@tensorflow.org> | 2016-04-14 14:24:46 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-04-14 15:32:56 -0700 |
commit | fd535e00fce5963f066b60b4a1e8822d4be92793 (patch) | |
tree | 255a0467b7234ad7ead9a6d106689b2b4bcd4c36 /tensorflow/core/util/sparse/group_iterator.cc | |
parent | e735c7903ada4651c4d4db2b5fb26f63c7dd65e6 (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.cc | 5 |
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_; |