[GitHub] [incubator-mxnet] TaoLv commented on issue #15930: Fix dtype inference in arange_like operator
TaoLv commented on issue #15930: Fix dtype inference in arange_like operator URL: https://github.com/apache/incubator-mxnet/pull/15930#issuecomment-522049857 @eric-haibin-lin @fhieber 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
[GitHub] [incubator-mxnet] TaoLv commented on issue #15930: Fix dtype inference in arange_like operator
TaoLv commented on issue #15930: Fix dtype inference in arange_like operator URL: https://github.com/apache/incubator-mxnet/pull/15930#issuecomment-522246438 @eric-haibin-lin Did you observe any crash with fp16 input? With below code snippet, it doesn't seem to crash but just gives numpy.float32 output: ```python import mxnet as mx import numpy as np x = mx.sym.Variable('x', dtype=np.float16) y = mx.sym.reshape(x, shape=(0, 0, -1)) z = mx.sym.contrib.arange_like(y, axis=-1) mod = z.simple_bind(ctx=mx.gpu(0), x=(3, 4, 5, 6), graph_req='null') mod.arg_arrays[0][:] = np.random.normal(size=mod.arg_arrays[0].shape).astype(np.float16) out = mod.forward(is_train=False) print(out[0].dtype) ``` 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
[GitHub] [incubator-mxnet] TaoLv commented on issue #15930: Fix dtype inference in arange_like operator
TaoLv commented on issue #15930: Fix dtype inference in arange_like operator URL: https://github.com/apache/incubator-mxnet/pull/15930#issuecomment-523068244 @eric-haibin-lin do you think the below code snippet can be used as a test case? ```python import mxnet as mx import numpy as np dtypes = [np.float16, np.float32, np.float64] for t in dtypes: x = mx.sym.Variable('x', dtype=t) y = mx.sym.reshape(x, shape=(0, 0, -1)) z = mx.sym.contrib.arange_like(y, axis=-1) mod = z.simple_bind(ctx=mx.gpu(0), x=(3, 4, 5, 6), graph_req='null') mod.arg_arrays[0][:] = np.random.normal(size=mod.arg_arrays[0].shape).astype(t) out = mod.forward(is_train=False) assert out[0].dtype == np.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
[GitHub] [incubator-mxnet] TaoLv commented on issue #15930: Fix dtype inference in arange_like operator
TaoLv commented on issue #15930: Fix dtype inference in arange_like operator URL: https://github.com/apache/incubator-mxnet/pull/15930#issuecomment-524635000 > I hope to reserve the dtype attribution, and there is a default action when dtype is None. Just want to provide the same user experience for `ones_like`, `zeros_like` and `arange_like`. 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