@@ -102,16 +102,16 @@ class Op {
102102 uint32_t num_outputs = 1 ;
103103 /* !
104104 * \brief get number of outputs given information about the node.
105- * \param attrs The attribute of the node
105+ * \param n The node
106106 * \return number of outputs.
107107 */
108- std::function<uint32_t (const NodeAttrs& attrs )> get_num_outputs = nullptr ;
108+ std::function<uint32_t (const Node& n )> get_num_outputs = nullptr ;
109109 /* !
110110 * \brief get number of inputs given information about the node.
111- * \param attrs The attribute of the node
111+ * \param n The node
112112 * \return number of inputs
113113 */
114- std::function<uint32_t (const NodeAttrs& attrs )> get_num_inputs = nullptr ;
114+ std::function<uint32_t (const Node& n )> get_num_inputs = nullptr ;
115115 /* !
116116 * \brief Attribute parser to parse the NodeAttrs information.
117117 *
@@ -136,11 +136,11 @@ class Op {
136136 * attrs->parsed = std::move(param);
137137 * }
138138 * // The other function that can utilize the parsed result.
139- * TShape SumInferShape(const NodeAttrs& attrs ,
139+ * TShape SumInferShape(const NodePtr& ptr ,
140140 * const std::vector<TShape>& ishapes) {
141141 * // we can use the parsed version of param
142142 * // without repeatively parsing the parameter
143- * const SumParam& param = nnvm::get<SumParam>(attrs.parsed);
143+ * const SumParam& param = nnvm::get<SumParam>(ptr-> attrs.parsed);
144144 * }
145145 * \endcode
146146 */
@@ -180,7 +180,7 @@ class Op {
180180 * \param fn The function to be set.
181181 * \return reference to self.
182182 */
183- inline Op& set_num_inputs (std::function<uint32_t (const NodeAttrs& attr )> fn); // NOLINT(*)
183+ inline Op& set_num_inputs (std::function<uint32_t (const Node& n )> fn); // NOLINT(*)
184184 /* !
185185 * \brief Set the num_outputs
186186 * \param n The number of outputs to be set.
@@ -192,7 +192,7 @@ class Op {
192192 * \param fn The function to be set.
193193 * \return reference to self.
194194 */
195- inline Op& set_num_outputs (std::function<uint32_t (const NodeAttrs& attr )> fn); // NOLINT(*)
195+ inline Op& set_num_outputs (std::function<uint32_t (const Node& n )> fn); // NOLINT(*)
196196 /* !
197197 * \brief Set the attr_parser function.
198198 * \param fn The number of outputs to be set.
@@ -279,10 +279,8 @@ class OpMap {
279279};
280280
281281// internal macros to make
282- #define NNVM_STR_CONCAT_ (__x, __y ) __x##__y
283- #define NNVM_STR_CONCAT (__x, __y ) NNVM_STR_CONCAT_(__x, __y)
284282#define NNVM_REGISTER_VAR_DEF (OpName ) \
285- static ::nnvm::Op & __make_ ## NnvmOp ## _ ## OpName
283+ static DMLC_ATTRIBUTE_UNUSED ::nnvm::Op & __make_ ## NnvmOp ## _ ## OpName
286284
287285/* !
288286 * \def NNVM_REGISTER_OP
@@ -300,7 +298,7 @@ class OpMap {
300298 * \endcode
301299 */
302300#define NNVM_REGISTER_OP (OpName ) \
303- NNVM_STR_CONCAT (NNVM_REGISTER_VAR_DEF(OpName), __COUNTER__) = \
301+ DMLC_STR_CONCAT (NNVM_REGISTER_VAR_DEF(OpName), __COUNTER__) = \
304302 ::dmlc::Registry<::nnvm::Op>::Get()->__REGISTER_OR_GET__(#OpName)
305303
306304// implementations of template functions after this.
@@ -377,7 +375,7 @@ inline Op& Op::set_num_inputs(uint32_t n) { // NOLINT(*)
377375 return *this ;
378376}
379377
380- inline Op& Op::set_num_inputs (std::function<uint32_t (const NodeAttrs& attr )> fn) { // NOLINT(*)
378+ inline Op& Op::set_num_inputs (std::function<uint32_t (const Node& n )> fn) { // NOLINT(*)
381379 this ->get_num_inputs = fn;
382380 return *this ;
383381}
@@ -387,7 +385,7 @@ inline Op& Op::set_num_outputs(uint32_t n) { // NOLINT(*)
387385 return *this ;
388386}
389387
390- inline Op& Op::set_num_outputs (std::function<uint32_t (const NodeAttrs& attr )> fn) { // NOLINT(*)
388+ inline Op& Op::set_num_outputs (std::function<uint32_t (const Node& n )> fn) { // NOLINT(*)
391389 this ->get_num_outputs = fn;
392390 return *this ;
393391}
0 commit comments