You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/09/16 05:11:55 UTC

[GitHub] [incubator-mxnet] tingying2020 commented on a change in pull request #16124: [numpy] [tvm] operator true_divide

tingying2020 commented on a change in pull request #16124: [numpy] [tvm] operator true_divide
URL: https://github.com/apache/incubator-mxnet/pull/16124#discussion_r324511593
 
 

 ##########
 File path: src/operator/numpy/np_true_divide.cc
 ##########
 @@ -41,19 +46,97 @@ bool TrueDivideType(const nnvm::NodeAttrs& attrs,
     const int lhs_dtype = in_attrs->at(0);
     const int rhs_dtype = in_attrs->at(1);
     CHECK_EQ(lhs_dtype, rhs_dtype)
-        << "_true_divide currently only supports same dtype for dividend and divisor";
+      << "_true_divide currently only supports same dtype for dividend and divisor";
   }
-  auto is_float = [](const int dtype) {
-    return dtype == mshadow::kFloat32 || dtype == mshadow::kFloat64 || dtype == mshadow::kFloat16;
-  };
-
-  for (const int dtype : *in_attrs) {
-    CHECK(is_float(dtype)) << "_true_divide currently only supports float dtype";
+  if (IsIntType(in_attrs->at(0))) {
+    TYPE_ASSIGN_CHECK(*out_attrs, 0, mshadow::kFloat64);
 
 Review comment:
   Changed to `float32`.

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


With regards,
Apache Git Services