Skip to content

Commit

Permalink
Cleanup of '-Wsign-compare' warnnigs. (apache#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
srkreddy1238 authored and sergei-mironov committed Aug 8, 2018
1 parent a505874 commit 217b8d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nnvm/src/top/tensor/matrix_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ inline bool DotShape(const nnvm::NodeAttrs& attrs,
<< "dot shape inconsistent: " << lshape << " X " << rshape;

TShape oshape(lshape.ndim() + rshape.ndim() - 2);
for (int i = 0; i < lshape.ndim() - 1; i++) oshape[i] = lshape[i];
for (int i = 1; i < rshape.ndim(); i++) oshape[i + lshape.ndim() - 2] = rshape[i];
for (uint32_t i = 0; i < lshape.ndim() - 1; i++) oshape[i] = lshape[i];
for (uint32_t i = 1; i < rshape.ndim(); i++) oshape[i + lshape.ndim() - 2] = rshape[i];

NNVM_ASSIGN_OUTPUT_SHAPE(attrs, *out_attrs, 0, oshape);
return true;
Expand Down
2 changes: 1 addition & 1 deletion nnvm/src/top/tensor/reduce.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Example::
for (dim_t i = 0; i < param.axis.ndim(); ++i) {
exclude_axis.insert(param.axis[i]);
}
for (dim_t i = 0; i < inputs[0].ndim(); ++i) {
for (dim_t i = 0; i < static_cast<int>(inputs[0].ndim()); ++i) {
if (exclude_axis.count(i) == 0) {
axis.push_back(make_const(Int(32), i));
}
Expand Down
2 changes: 1 addition & 1 deletion nnvm/src/top/tensor/transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ inline bool TransposeCorrectLayout(const NodeAttrs& attrs,
} else {
CHECK_EQ(input.ndim(), param.axes.ndim());
for (size_t i = 0; i < input.ndim(); ++i) {
CHECK(param.axes[i] < input.ndim());
CHECK(param.axes[i] < static_cast<int>(input.ndim()));
new_layout << input.at(param.axes[i]);
}
}
Expand Down

0 comments on commit 217b8d7

Please sign in to comment.