Skip to content

Commit

Permalink
[Compilation Warning Fix] in matrix_op.cc (dmlc#356)
Browse files Browse the repository at this point in the history
The below compilation warning issue has been fixed.

src/top/tensor/matrix_op.cc:37:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < lshape.ndim() - 1; i++) oshape[i] = lshape[i];
                     ^
src/top/tensor/matrix_op.cc:38:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 1; i < rshape.ndim(); i++) oshape[i + lshape.ndim() - 1] = rshap
  • Loading branch information
siju-samuel authored and tqchen committed Feb 3, 2018
1 parent ae8c495 commit 6004907
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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() - 1);
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() - 1] = rshape[i];
for (size_t i = 0; i < lshape.ndim() - 1; i++) oshape[i] = lshape[i];
for (size_t i = 1; i < rshape.ndim(); i++) oshape[i + lshape.ndim() - 1] = rshape[i];

NNVM_ASSIGN_OUTPUT_SHAPE(attrs, *out_attrs, 0, oshape);
return true;
Expand Down

0 comments on commit 6004907

Please sign in to comment.