Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
address the comment
Browse files Browse the repository at this point in the history
  • Loading branch information
stu1130 committed Aug 30, 2019
1 parent 646e0ba commit a881715
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/mxnet/tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,11 @@ class Tuple {
* \return the corresponding dimension size
*/
inline ValueType& operator[](int i) {
// it fixes the false alarm of assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow]
// it fixes the false alarm of assuming signed overflow does not occur
// when assuming that (X - c) > X is always false [-Werror=strict-overflow]
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-overflow"
CHECK(i >= 0 && i < ndim()) << "index = " << i << " must be in range [0, " << ndim() << ")";
CHECK(i >= 0 && i < ndim()) << "index = " << i << " must be in range [0, " << ndim() << ")";
#pragma GCC diagnostic pop
return begin()[i];
}
Expand All @@ -212,7 +213,12 @@ class Tuple {
* \return the corresponding dimension size
*/
inline const ValueType& operator[](int i) const {
// it fixes the false alarm of assuming signed overflow does not occur
// when assuming that (X - c) > X is always false [-Werror=strict-overflow]
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-overflow"
CHECK(i >= 0 && i < ndim()) << "index = " << i << " must be in range [0, " << ndim() << ")";
#pragma GCC diagnostic pop
return begin()[i];
}
/*!
Expand Down

0 comments on commit a881715

Please sign in to comment.