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


With regards,
Apache Git Services

Reply via email to