samskalicky commented on a change in pull request #17270: [WIP] Dynamic custom
operator GPU support
URL: https://github.com/apache/incubator-mxnet/pull/17270#discussion_r367713125
##########
File path: include/mxnet/lib_api.h
##########
@@ -833,20 +891,26 @@ extern "C" {
#else
void
#endif
- _opRegGet(int idx, const char** name, fcomp_t* fcomp, fcomp_t* fgrad,
+ _opRegGet(int idx, const char** name,
+ const char*** forward_ctx, fcomp_t** forward_fp, int*
forward_count,
+ const char*** backward_ctx, fcomp_t** backward_fp, int*
backward_count,
parseAttrs_t* parse, inferType_t* type,
inferShape_t* shape, mutateInputs_t* mutate,
createOpState_t* create_op, int *isSGop) {
- CustomOp op = Registry<CustomOp>::get()->get(idx);
- *name = op.name;
- *fcomp = op.forward;
- *fgrad = op.backward;
- *parse = op.parse_attrs;
- *type = op.infer_type;
- *shape = op.infer_shape;
- *mutate = op.mutate_inputs;
- *create_op = op.create_opstate;
- *isSGop = op.isSGop;
+ CustomOp *op = &(Registry<CustomOp>::get()->get(idx));
Review comment:
maybe try:
```
CustomOp& op = Registry<CustomOp>::get()->get(idx);
```
----------------------------------------------------------------
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