You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/05/21 19:03:53 UTC

[GitHub] [incubator-mxnet] larroy commented on a change in pull request #14900: Fix warning / static function in header.

larroy commented on a change in pull request #14900: Fix warning / static function in header.
URL: https://github.com/apache/incubator-mxnet/pull/14900#discussion_r286179203
 
 

 ##########
 File path: src/operator/nn/dropout-inl.h
 ##########
 @@ -492,7 +492,7 @@ class DropoutOp {
 #endif  // MXNET_USE_CUDNN_DROPOUT
 };  // class DropoutOp
 
-static OpStatePtr CreateDropoutState(const nnvm::NodeAttrs &attrs,
+inline OpStatePtr CreateDropoutState(const nnvm::NodeAttrs &attrs,
 
 Review comment:
   file included from /Users/pllarroy/devel/mxnet/tests/cpp/operator/dropout_perf.cc:30:
   /Users/pllarroy/devel/mxnet/3rdparty/mshadow/../../src/operator/nn/dropout-inl.h:495:19: warning: unused function 'CreateDropoutState' [-Wunused-function]
   static OpStatePtr CreateDropoutState(const nnvm::NodeAttrs &attrs,
                     ^
   
   But the relevant part is that
   This is going to create multiple instantiations of this function, is not correct to have a static function in a header.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services