apeforest commented on a change in pull request #15042: [MXNET-1405] tests for
large tensor support for Softmax operator
URL: https://github.com/apache/incubator-mxnet/pull/15042#discussion_r286775537
##########
File path: tests/nightly/test_large_array.py
##########
@@ -279,6 +279,19 @@ def test_diag():
assert_almost_equal(r.asnumpy(), np.diag(a_np, k=k))
+def test_softmax():
+ def softmax_forward(input_data, true_output):
+ data = mx.sym.Variable('data')
+ out1 = data.softmax(axis=0)
+ exec1 = out1.bind(mx.cpu(), args={'data': input_data})
+ exec1.forward()[0].wait_to_read()
+ ndarr = exec1.outputs[0]
+ nparr = ndarr.asnumpy()
+ assert_almost_equal(nparr, true_output, rtol=1e-5, atol=1e-5)
+
+ softmax_forward(mx.nd.ones((128, LARGE_X)), np.full((128, LARGE_X),
0.0078125))
Review comment:
Is this 0.0078125 hand calculated? How to verify it? Can you use numpy
calculation as the expected result?
----------------------------------------------------------------
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