@@ -20,7 +20,7 @@ struct VariableParam {
2020
2121NodePtr CreateVariableNode (const std::string& name) {
2222 NodePtr n = Node::Create ();
23- n->op = nullptr ;
23+ n->attrs . op = nullptr ;
2424 n->attrs .name = name;
2525 n->attrs .parsed = VariableParam ();
2626 return n;
@@ -37,8 +37,8 @@ inline void UpdateNodeVersion(Node *n) {
3737 e.version = nnvm::get<VariableParam>(e.node ->attrs .parsed ).version ;
3838 }
3939 }
40- if (fmutate_inputs.count (n->op ) != 0 ) {
41- for (uint32_t i : fmutate_inputs[n->op ](n->attrs )) {
40+ if (fmutate_inputs.count (n->op () ) != 0 ) {
41+ for (uint32_t i : fmutate_inputs[n->op () ](n->attrs )) {
4242 NodeEntry& e = n->inputs [i];
4343 CHECK (e.node ->is_variable ())
4444 << " Mutation target can only be Variable" ;
@@ -96,7 +96,6 @@ Symbol Symbol::Copy() const {
9696 // use DFSVisit to copy all the nodes
9797 DFSVisit (this ->outputs , [&old_new](const NodePtr& node) {
9898 NodePtr np = Node::Create ();
99- np->op = node->op ;
10099 np->attrs = node->attrs ;
101100 old_new[node.get ()] = std::move (np);
102101 });
@@ -123,7 +122,7 @@ void Symbol::Print(std::ostream &os) const {
123122 if (outputs[0 ].node ->is_variable ()) {
124123 os << " Variable:" << outputs[0 ].node ->attrs .name << ' \n ' ;
125124 } else {
126- os << " AtomicFunctor " << " Op:" << outputs[0 ].node ->op ->name << ' \n ' ;
125+ os << " AtomicFunctor " << " Op:" << outputs[0 ].node ->op () ->name << ' \n ' ;
127126 }
128127 } else {
129128 // use DFSVisit to copy all the nodes
@@ -137,7 +136,7 @@ void Symbol::Print(std::ostream &os) const {
137136 os << " Variable:" << node->attrs .name << ' \n ' ;
138137 } else {
139138 os << " --------------------\n " ;
140- os << " Op:" << node->op ->name << " , Name=" << node->attrs .name << ' \n '
139+ os << " Op:" << node->op () ->name << " , Name=" << node->attrs .name << ' \n '
141140 << " Inputs:\n " ;
142141 for (size_t i = 0 ; i < node->inputs .size (); ++i) {
143142 const NodeEntry& e = node->inputs [i];
@@ -196,8 +195,8 @@ std::vector<std::string> Symbol::ListInputNames(ListInputOption option) const {
196195 DFSVisit (this ->outputs , [&ret, &mutable_set, &vlist](const NodePtr &node) {
197196 if (node->is_variable ()) {
198197 vlist.push_back (node.get ());
199- } else if (fmutate_inputs.count (node->op )) {
200- for (uint32_t i : fmutate_inputs[node->op ](node->attrs )){
198+ } else if (fmutate_inputs.count (node->op () )) {
199+ for (uint32_t i : fmutate_inputs[node->op () ](node->attrs )){
201200 mutable_set.insert (node->inputs [i].node .get ());
202201 }
203202 }
@@ -221,7 +220,7 @@ std::vector<std::string> Symbol::ListOutputNames() const {
221220 } else {
222221 const std::string& hname = head.node ->attrs .name ;
223222 std::string rname;
224- FListOutputNames fn = flist_ouputs.get (head.node ->op , nullptr );
223+ FListOutputNames fn = flist_ouputs.get (head.node ->op () , nullptr );
225224 if (fn != nullptr ) {
226225 rname = fn (head.node ->attrs )[head.index ];
227226 } else {
@@ -278,10 +277,10 @@ void Symbol::Compose(const array_view<const Symbol*>& args,
278277 }
279278 // switch to keyword argument matching
280279 if (args.size () != n_req) {
281- FListInputNames fn = flist_inputs.get (n->op , nullptr );
280+ FListInputNames fn = flist_inputs.get (n->op () , nullptr );
282281 auto arg_names = (fn == nullptr ) ? std::vector<std::string>{" data" } : fn (n->attrs );
283282 if (arg_names.size () != n_req) {
284- LOG (FATAL) << " Not enough argument to call operator " << outputs[0 ].node ->op ->name ;
283+ LOG (FATAL) << " Not enough argument to call operator " << outputs[0 ].node ->op () ->name ;
285284 }
286285 size_t nmatched = 0 ;
287286 for (size_t i = args.size (); i < n_req; ++i) {
@@ -422,8 +421,8 @@ void Symbol::SetAttrs(const std::vector<std::pair<std::string, std::string> >& a
422421 node->attrs .dict [kv.first ] = kv.second ;
423422 }
424423 }
425- if (node->op != nullptr && node->op ->attr_parser != nullptr ) {
426- node->op ->attr_parser (&(node->attrs ));
424+ if (node->op () != nullptr && node->op () ->attr_parser != nullptr ) {
425+ node->op () ->attr_parser (&(node->attrs ));
427426 }
428427}
429428
@@ -461,10 +460,10 @@ Symbol Symbol::CreateFunctor(const Op* op,
461460 std::unordered_map<std::string, std::string> attrs) {
462461 Symbol s;
463462 NodePtr n = Node::Create ();
464- n->op = op;
463+ n->attrs . op = op;
465464 n->attrs .dict = std::move (attrs);
466- if (n->op ->attr_parser != nullptr ) {
467- n->op ->attr_parser (&(n->attrs ));
465+ if (n->op () ->attr_parser != nullptr ) {
466+ n->op () ->attr_parser (&(n->attrs ));
468467 }
469468 s.outputs .emplace_back (NodeEntry{std::move (n), 0 , 0 });
470469 return s;
0 commit comments