eric-haibin-lin commented on a change in pull request #9625: sparse regression
operators
URL: https://github.com/apache/incubator-mxnet/pull/9625#discussion_r170439239
##########
File path: tests/python/unittest/test_operator.py
##########
@@ -219,13 +219,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_data = mx.random.uniform(-1, 1, shape)
+ arr_label = mx.random.uniform(0, 1, shape).tostype(stype)
Review comment:
Can we test with actual sparse data with density = [0,0.5,1]?
----------------------------------------------------------------
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