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_r299705745
##########
File path: amalgamation/python/mxnet_predict.py
##########
@@ -160,10 +249,18 @@ def forward(self, **kwargs):
>>> predictor.forward(data=mydata)
>>> out = predictor.get_output(0)
"""
+ if self.type_dict and len(self.type_dict) != len(kwargs.items()):
+ raise ValueError("number of kwargs should be same as len of
type_dict" \
+ "Please check your forward pass inputs" \
+ "or type_dict passed to Predictor instantiation")
+
for k, v in kwargs.items():
if not isinstance(v, np.ndarray):
raise ValueError("Expect numpy ndarray as input")
- v = np.asarray(v, dtype=np.float32, order='C')
+ if self.type_dict and k in self.type_dict:
+ v = np.asarray(v, dtype=self.type_dict[k], order='C')
Review comment:
Can you help me understand importance of Column major 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:
[email protected]
With regards,
Apache Git Services