ciyongch commented on a change in pull request #14914: Add primitive cache for 
MKL-DNN sum(elemwise_add operator
URL: https://github.com/apache/incubator-mxnet/pull/14914#discussion_r282455244
 
 

 ##########
 File path: src/operator/tensor/elemwise_binary_op_basic.cc
 ##########
 @@ -30,6 +30,12 @@
 namespace mxnet {
 namespace op {
 
+bool SupportMKLDNNSum(const NDArray& input) {
+  int ndim = input.shape().ndim();
+  return input.dtype() == mshadow::kFloat32 && (ndim >= 1 && ndim <= 4) &&
+         input.storage_type() == kDefaultStorage;
+}
 
 Review comment:
   Currently, some MKLDNN ops supports ndim [1, 4], while some ops still 
doesn't support ndim=3. 
   For now, there would be several such support check functions for different 
ops. 
   But indeed, we can combine all the similar function when all the ops are 
finalized. 

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