Commit c7474c00 by Siva Committed by Tianqi Chen

Cleanup of '-Wsign-compare' warnnigs. (#504)

parent 71ffc2b6
...@@ -34,8 +34,8 @@ inline bool DotShape(const nnvm::NodeAttrs& attrs, ...@@ -34,8 +34,8 @@ inline bool DotShape(const nnvm::NodeAttrs& attrs,
<< "dot shape inconsistent: " << lshape << " X " << rshape; << "dot shape inconsistent: " << lshape << " X " << rshape;
TShape oshape(lshape.ndim() + rshape.ndim() - 2); TShape oshape(lshape.ndim() + rshape.ndim() - 2);
for (int i = 0; i < lshape.ndim() - 1; i++) oshape[i] = lshape[i]; for (uint32_t 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 = 1; i < rshape.ndim(); i++) oshape[i + lshape.ndim() - 2] = rshape[i];
NNVM_ASSIGN_OUTPUT_SHAPE(attrs, *out_attrs, 0, oshape); NNVM_ASSIGN_OUTPUT_SHAPE(attrs, *out_attrs, 0, oshape);
return true; return true;
......
...@@ -145,7 +145,7 @@ Example:: ...@@ -145,7 +145,7 @@ Example::
for (dim_t i = 0; i < param.axis.ndim(); ++i) { for (dim_t i = 0; i < param.axis.ndim(); ++i) {
exclude_axis.insert(param.axis[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) { if (exclude_axis.count(i) == 0) {
axis.push_back(make_const(Int(32), i)); axis.push_back(make_const(Int(32), i));
} }
......
...@@ -760,7 +760,7 @@ inline bool TransposeCorrectLayout(const NodeAttrs& attrs, ...@@ -760,7 +760,7 @@ inline bool TransposeCorrectLayout(const NodeAttrs& attrs,
} else { } else {
CHECK_EQ(input.ndim(), param.axes.ndim()); CHECK_EQ(input.ndim(), param.axes.ndim());
for (size_t i = 0; i < input.ndim(); ++i) { 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]); new_layout << input.at(param.axes[i]);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment