sxjscience commented on a change in pull request #18251:
URL: https://github.com/apache/incubator-mxnet/pull/18251#discussion_r424828140
##########
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:
I just realized that in numpy, the default dtype of arange is int64.
```python
import numpy as np
print(np.arange(10).dtype)
import mxnet as mx
mx.npx.set_np()
print(mx.np.arange(10).dtype)
```
Output:
```
int64
float32
```
Thus, we should change the dtype to be consistent with the official numpy.
What do you think @yzhliu @leezu
----------------------------------------------------------------
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]