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:
[email protected]


With regards,
Apache Git Services

Reply via email to