wkcn commented on a change in pull request #14948: [MXNET-1403] Disable numpy's
writability of NDArray once it is zero-copied to MXNet
URL: https://github.com/apache/incubator-mxnet/pull/14948#discussion_r284031125
##########
File path: tests/python/unittest/test_ndarray.py
##########
@@ -1687,8 +1687,10 @@ def test_zero_from_numpy():
mx.test_utils.assert_almost_equal(np_array, mx_array.asnumpy())
np_array = arrays[0]
mx_array = mx.nd.from_numpy(np_array)
- np_array[2, 1] = 0
- mx.test_utils.assert_almost_equal(np_array, mx_array.asnumpy())
+ try:
+ np_array[2, 1] = 0
Review comment:
Thank you for the fix! I think it should add a new line to raise a Exception
which is not ValueError after assignment.
----------------------------------------------------------------
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