Skip to content

Commit

Permalink
declare a type name for each tuple type (#151)
Browse files Browse the repository at this point in the history
* declare a type name for each tuple type

* generic way to declare type names for each tuple type

* fix lint error

* update submodule dmlc-core
  • Loading branch information
pierric authored and tqchen committed Sep 24, 2017
1 parent e75c53e commit 8081a7f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions include/nnvm/tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <algorithm>
#include <utility>
#include <iostream>
#include <string>
#include "./base.h"

namespace nnvm {
Expand Down Expand Up @@ -611,4 +612,13 @@ struct hash<nnvm::TShape> {
};
} // namespace std

namespace dmlc {
template<typename T>
struct type_name_helper<nnvm::Tuple<T> > {
static inline std::string value() {
return "tuple of <" + type_name<T>() + ">";
}
};
}

#endif // NNVM_TUPLE_H_

0 comments on commit 8081a7f

Please sign in to comment.