Skip to content
乔龙飞 edited this page Jun 16, 2017 · 1 revision
// brief an entry that represents output data from a node.
struct NodeEntry {
  NodePtr node;
  // index of output from the source.
  uint32_t index;
  /*!
   * 对于Variable node.
   *  version is increased by one each time a Variable get composed to a mutation Op.
   *  This information can be helpful to decide order of operations when sequence of mutation happens.
   */
  uint32_t version;
};
class Node {
 public:
  NodeAttrs attrs;
  std::vector<NodeEntry> inputs;
  std::vector<NodePtr> control_deps;
};
struct NodeAttrs {
  std::string name;
  // place holder variable, op == nullptr.
  const Op *op{nullptr};
  std::unordered_map<std::string, std::string> dict;
};
Clone this wiki locally