You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2017/12/20 18:06:35 UTC

[incubator-mxnet] branch master updated: Fix float16 min and max (#9149)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 080d29c  Fix float16 min and max (#9149)
080d29c is described below

commit 080d29cb1a2daa903f99a6fa7c3f5f6dba2771dd
Author: reminisce <wu...@gmail.com>
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 984a3a7..3d87ed2 160000
--- a/mshadow
+++ b/mshadow
@@ -1 +1 @@
-Subproject commit 984a3a7c253a9b590c17206f8d926bdaafdea997
+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
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].