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 2017/11/09 21:27:28 UTC

[GitHub] cjolivier01 commented on a change in pull request #8302: Refactor operators

cjolivier01 commented on a change in pull request #8302: Refactor operators
URL: https://github.com/apache/incubator-mxnet/pull/8302#discussion_r150090203
 
 

 ##########
 File path: src/operator/nn/fully_connected-inl.h
 ##########
 @@ -176,124 +162,80 @@ class FullyConnectedOp : public Operator {
     linalg_gemm(grad, wmat, gdata, false, false, s, req[fullc::kData]);
   }
 
+  static FullyConnectedOp &get_op(const FullyConnectedParam& param) {
+    static thread_local FullyConnectedOp op;
+    op.Init(param);
+    return op;
+  }
+
 
 Review comment:
   What's the reasoning behind the static/thread_local object? What calls this? What's the guarantee that this won;t ever be called more than once on the same thread, or is there a reason it doesn't matter?  Seems like it would call Init() more than once in this case?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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