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

 ##########
 File path: amalgamation/python/mxnet_predict.py
 ##########
 @@ -133,15 +199,38 @@ def __init__(self, symbol_file,
         handle = PredictorHandle()
         param_raw_bytes = bytearray(param_raw_bytes)
         ptr = (ctypes.c_char * 
len(param_raw_bytes)).from_buffer(param_raw_bytes)
-        _check_call(_LIB.MXPredCreate(
+
+        # data types
+        num_provided_arg_types = 0
+        # provided type argument names
+        provided_arg_type_names = ctypes.POINTER(ctypes.c_char_p)()
+        # provided types
+        provided_arg_type_data = ctypes.POINTER(mx_uint)()
+        if type_dict is not None:
+            provided_arg_type_names = []
+            provided_arg_type_data = []
+            for k, v in type_dict.items():
+                v = np.dtype(v).type
+                if v in _DTYPE_NP_TO_MX:
+                    provided_arg_type_names.append(k)
 
 Review comment:
   Here we are depending on index of the element? I remember we had issues due 
to dependence on position in the past due to different in Python list 
maintaining elements in Python2 / 3. Should we use a map instead here (name -> 
type)?

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