anirudh2290 commented on a change in pull request #15245: FP16 Support for C 
Predict API
URL: https://github.com/apache/incubator-mxnet/pull/15245#discussion_r299725608
 
 

 ##########
 File path: src/c_api/c_predict_api.cc
 ##########
 @@ -210,19 +249,31 @@ int _CreatePartialOut(const char* symbol_json_str,
 
   std::vector<NDArray> arg_arrays, aux_arrays;
   for (size_t i = 0; i < arg_shapes.size(); ++i) {
-    NDArray nd = NDArray(arg_shapes[i], ctx);
+    NDArray nd;
+    if (result_arg_types[i] != -1) {
+      nd = NDArray(arg_shapes[i], ctx, false, result_arg_types[i]);
+    } else {
+      nd = NDArray(arg_shapes[i], ctx);
+    }
     if (arg_params.count(arg_names[i]) != 0) {
       CopyFromTo(arg_params[arg_names[i]], &nd);
     }
     arg_arrays.push_back(nd);
   }
+
   for (size_t i = 0; i < aux_shapes.size(); ++i) {
-    NDArray nd = NDArray(aux_shapes[i], ctx);
+    NDArray nd;
+    if (result_aux_types[i] != -1) {
 
 Review comment:
   This was added as I was foreseeing the AMP change. and didnt even have the 
   ```
       CHECK(infer_type_complete)
           << "The type information is not enough, please provide input 
arg_types "
              "with provided_arg_dtype_names and provided_arg_dtypes";
   ```
   Will add a test for AMP for C Predict API and then get back here.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to