sxjscience commented on a change in pull request #18251:
URL: https://github.com/apache/incubator-mxnet/pull/18251#discussion_r426231880



##########
File path: src/api/operator/numpy/np_init_op.cc
##########
@@ -216,7 +217,7 @@ MXNET_REGISTER_API("_npi.arange")
   param.repeat = 1;
   param.infer_range = false;
   if (args[3].type_code() == kNull) {
-    param.dtype = mshadow::kFloat32;
+    param.dtype = mxnet::common::GetDefaultDtype();

Review comment:
       In fact, arange is usually used for constructing the index. Sometimes, 
the user may use `np.arange(0, 1000*1000*1000, 10000)` and we will lose 
precision if we use float32. In addition, pytorch uses int64.
   
   ```python
   import torch as th
   
   print(th.arange(10).dtype)
   # torch.int64
   ```




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


Reply via email to