Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Add GetName function in Symbol class for cpp pack
Browse files Browse the repository at this point in the history
  • Loading branch information
Hao Jin committed Aug 8, 2018
1 parent 9b18af8 commit b351d5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cpp-package/include/mxnet-cpp/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ class Symbol {
std::vector<std::string> ListOutputs() const;
/*! \return get the descriptions of auxiliary data for this symbol */
std::vector<std::string> ListAuxiliaryStates() const;
/*! \return get the name of the symbol */
std::string GetName() const;
/*!
* \brief infer and construct all the arrays to bind to executor by providing
* some known arrays.
Expand Down
7 changes: 7 additions & 0 deletions cpp-package/include/mxnet-cpp/symbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ inline std::vector<std::string> Symbol::ListAuxiliaryStates() const {
return ret;
}

inline std::string Symbol::GetName() const {
int success;
const char* out_name;
CHECK_EQ(MXSymbolGetName(GetHandle(), &out_name, &success), 0);
return std::string(out_name);
}

inline void Symbol::InferShape(
const std::map<std::string, std::vector<mx_uint> > &arg_shapes,
std::vector<std::vector<mx_uint> > *in_shape,
Expand Down

0 comments on commit b351d5c

Please sign in to comment.