mseth10 commented on a change in pull request #17623: Dynamic subgraph compile
support
URL: https://github.com/apache/incubator-mxnet/pull/17623#discussion_r392534373
##########
File path: src/c_api/c_api.cc
##########
@@ -122,14 +122,28 @@ void CustomFComputeDispatcher(const std::string op_name,
// convert inputs/outpus NDArray to C types to be passed to lib_api.h
for (size_t i = 0; i < inputs.size(); i++) {
- in_data.push_back(inputs[i].data().dptr_);
- in_shapes.push_back(inputs[i].shape().data());
- in_dims.push_back(inputs[i].shape().ndim());
- in_types.push_back(inputs[i].dtype());
- in_verIDs.push_back(inputs[i].version());
- const char* ctx_str = inputs[i].ctx().dev_mask() == Context::kCPU ? "cpu"
: "gpu";
- in_dev_type.push_back(ctx_str);
- in_dev_id.push_back(inputs[i].ctx().real_dev_id());
+ const NDArray& in_nd = inputs[i];
+ // reorder data if in MKLDNN format
+ if (in_nd.IsMKLDNNData()) {
+ const NDArray& tmp_nd = in_nd.Reorder2Default();
Review comment:
Can we just keep `in_nd.Reorder2Default()` inside if block, the rest looks
same for if and else block.
----------------------------------------------------------------
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