eric-haibin-lin commented on a change in pull request #9625: sparse regression
operators
URL: https://github.com/apache/incubator-mxnet/pull/9625#discussion_r164910189
##########
File path: tests/python/unittest/test_operator.py
##########
@@ -216,13 +216,13 @@ def check_slice_channel(data_ndim, axis, num_outputs,
squeeze_axis):
check_slice_channel(data_ndim=5, axis=-2, num_outputs=3, squeeze_axis=True)
-def check_regression(symbol, forward, backward):
+def check_regression(symbol, forward, backward, stype='default'):
data = mx.symbol.Variable('data')
- label = mx.symbol.Variable('label')
+ label = mx.symbol.Variable('label', stype=stype)
out = symbol(data, label)
shape = (3, 1)
arr_data = mx.random.uniform(-1, 1, shape,
ctx=mx.cpu()).copyto(default_context())
- arr_label = mx.random.uniform(0, 1, shape[0],
ctx=mx.cpu()).copyto(default_context())
+ arr_label = mx.random.uniform(0, 1, shape,
ctx=mx.cpu()).copyto(default_context()).tostype(stype)
Review comment:
Doesn't `mx.random.uniform ` use default ctx already?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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