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_r399493839
##########
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:
DefaultSubgraphOpResourceRequest calls
DefaultSubgraphOpResourceRequestHelper which goes through the ops in the
subgraph and sets all resources requested by any op in the subgraph. One of
these could be a custom op who's defining the resource request.
You have a good point though, we should probably just have subgraph ops
define all supported resources anyway.
----------------------------------------------------------------
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