Skip to content

Commit

Permalink
Merge pull request apache#94 from zhangchen-qinyinghua/master
Browse files Browse the repository at this point in the history
Make the stream operator for Shape consistent
  • Loading branch information
tqchen committed Jan 14, 2016
2 parents 29863c5 + 7c7e433 commit 1da409c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mshadow/tensor_blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ struct TShape {
inline std::ostream &operator<<(std::ostream &os, const TShape &shape) {
os << '(';
for (index_t i = 0; i < shape.ndim(); ++i) {
if (i != 0) os << ", ";
if (i != 0) os << ',';
os << shape[i];
}
// python style tuple
Expand Down
8 changes: 5 additions & 3 deletions mshadow/tensor_cpu-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ inline void DeleteStream<cpu>(Stream<cpu> *stream) {

template<int ndim>
inline std::ostream &operator<<(std::ostream &os, const Shape<ndim> &shape) { // NOLINT(*)
os << "(";
os << '(';
for (int i = 0; i < ndim; ++i) {
if (i != 0) os << ",";
if (i != 0) os << ',';
os << shape[i];
}
os << ")";
// python style tuple
if (ndim == 1) os << ',';
os << ')';
return os;
}

Expand Down

0 comments on commit 1da409c

Please sign in to comment.