This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch v1.0.0
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/v1.0.0 by this push:
     new 7a83d67  Fix float16 min and max (#9149)
7a83d67 is described below

commit 7a83d67ecd3e49a3b342cc896598cc0d44de60e0
Author: reminisce <[email protected]>
AuthorDate: Wed Dec 20 10:06:29 2017 -0800

    Fix float16 min and max (#9149)
    
    * Add unittest for float16 min and max
    
    * Add mshadow fix
---
 mshadow                                | 2 +-
 tests/python/unittest/test_operator.py | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/mshadow b/mshadow
index 2d7780c..3d87ed2 160000
--- a/mshadow
+++ b/mshadow
@@ -1 +1 @@
-Subproject commit 2d7780c3f2eefe4453fa419862d1b2089bedb8d5
+Subproject commit 3d87ed2a4b47ef749c616f208cee45d920fb6e6e
diff --git a/tests/python/unittest/test_operator.py 
b/tests/python/unittest/test_operator.py
index 19c4e65..ba1b991 100644
--- a/tests/python/unittest/test_operator.py
+++ b/tests/python/unittest/test_operator.py
@@ -4668,6 +4668,14 @@ def test_slice():
     check_numeric_gradient(slice_sym, [in_data])
 
 
+def test_float16_min_max():
+    """Test for issue: https://github.com/apache/incubator-mxnet/issues/9007""";
+    a = mx.nd.array([np.finfo('float16').min, np.finfo('float16').max], 
dtype='float16')
+    assert a.dtype == np.float16
+    assert np.finfo('float16').min == mx.nd.min(a).asscalar()
+    assert np.finfo('float16').max == mx.nd.max(a).asscalar()
+
+
 if __name__ == '__main__':
     import nose
     nose.runmodule()

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to