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 0a0a31e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions include/mxnet/tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ class Tuple {
*/
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]
#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
#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 All @@ -212,7 +212,11 @@ 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 0a0a31e

Please sign in to comment.