rshyamsundar opened a new issue #16407: Output of sampling method always has float32 type irrespective of the type of the parameters URL: https://github.com/apache/incubator-mxnet/issues/16407 ## Description Output of sampling method for various distributions (normal, gamma, etc.) always has `np.float32` type irrespective of the type of the parameters passed. Ideally the returned samples should have the same `dtype` as the parameters passed. ## Environment info (Required) ``` ----------Python Info---------- Version : 3.6.5 Compiler : GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2) Build : ('default', 'Jun 17 2018 12:13:06') Arch : ('64bit', '') ------------Pip Info----------- Version : 19.2.1 Directory : /usr/local/lib/python3.6/site-packages/pip ----------MXNet Info----------- Version : 1.5.1 Directory : /usr/local/lib/python3.6/site-packages/mxnet Commit Hash : c9818480680f84daa6e281a974ab263691302ba8 Library : ['/usr/local/lib/python3.6/site-packages/mxnet/libmxnet.so'] Build features: ✖ CUDA ✖ CUDNN ✖ NCCL ✖ CUDA_RTC ✖ TENSORRT ✔ CPU_SSE ✔ CPU_SSE2 ✔ CPU_SSE3 ✔ CPU_SSE4_1 ✔ CPU_SSE4_2 ✖ CPU_SSE4A ✔ CPU_AVX ✖ CPU_AVX2 ✖ OPENMP ✖ SSE ✖ F16C ✖ JEMALLOC ✖ BLAS_OPEN ✖ BLAS_ATLAS ✖ BLAS_MKL ✖ BLAS_APPLE ✔ LAPACK ✖ MKLDNN ✔ OPENCV ✖ CAFFE ✖ PROFILER ✔ DIST_KVSTORE ✖ CXX14 ✖ INT64_TENSOR_SIZE ✔ SIGNAL_HANDLER ✖ DEBUG ----------System Info---------- Platform : Darwin-17.7.0-x86_64-i386-64bit system : Darwin node : 4c327598c595.ant.amazon.com release : 17.7.0 version : Darwin Kernel Version 17.7.0: Sun Jun 2 20:31:42 PDT 2019; root:xnu-4570.71.46~1/RELEASE_X86_64 ----------Hardware Info---------- machine : x86_64 processor : i386 b'machdep.cpu.brand_string: Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz' b'machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C' b'machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 AVX2 BMI2 INVPCID SMAP RDSEED ADX IPT FPU_CSDS MD_CLEAR IBRS STIBP L1DF SSBD' b'machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT PREFETCHW RDTSCP TSCI' ----------Network Test---------- Setting timeout: 10 Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.1143 sec, LOAD: 0.9243 sec. Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.1232 sec, LOAD: 1.0671 sec. Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.1203 sec, LOAD: 0.7703 sec. Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.1115 sec, LOAD: 0.5783 sec. Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.1102 sec, LOAD: 1.1630 sec. Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.1120 sec, LOAD: 0.1953 sec. ----------Environment---------- KMP_DUPLICATE_LIB_OK="True" ``` Package used (Python/R/Scala/Julia): I'm using Python 3.6.5 ## Build info (Required if built from source) Compiler (gcc/clang/mingw/visual studio): MXNet commit hash: c981848 (version: 1.5.1) ## Minimum reproducible example ``` In [1]: import mxnet as mx In [2]: import numpy as np In [3]: mu = mx.nd.array([1], dtype=np.float64) In [4]: sigma = mx.nd.array([0.1], dtype=np.float64) In [5]: sample = mx.nd.sample_normal(mu, sigma) In [6]: mu.dtype, sigma.dtype, sample.dtype Out[6]: (numpy.float64, numpy.float64, numpy.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: [email protected] With regards, Apache Git Services
