samskalicky commented on a change in pull request #17762: Custom Operator 
Random Number Generator Support
URL: https://github.com/apache/incubator-mxnet/pull/17762#discussion_r399433340
 
 

 ##########
 File path: src/c_api/c_api.cc
 ##########
 @@ -248,11 +251,24 @@ void CustomFComputeDispatcher(const std::string op_name,
   // get actual cudaStream_t out of mxnet gpu stream and pass to lib_api.h
   void *cuda_stream = nullptr;
 #if MXNET_USE_CUDA
-  if (inputs[0].ctx().dev_mask() == Context::kGPU) {
+  if (inputs.size() > 0 && inputs[0].ctx().dev_mask() == Context::kGPU) {
     cuda_stream = static_cast<void*>(gpu_stream->stream_);
   }
 #endif
 
+  // get mxnet initialized and seeded RNG states and pass to lib_api.h
+  void *rng_cpu_states = nullptr, *rng_gpu_states = nullptr;
+  if (!is_subgraph_op) {
 
 Review comment:
   why are we only doing this for non-subgraph ops? Subgraph ops cant get RNG?

----------------------------------------------------------------
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