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 2018/01/26 18:05:25 UTC

[incubator-mxnet] branch master updated: Add checksum for test_consistency (#9570)

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 6f3f171  Add checksum for test_consistency (#9570)
6f3f171 is described below

commit 6f3f171707d456c49167af381bd65dbbb0b3ce06
Author: Anirudh Subramanian <an...@gmail.com>
AuthorDate: Fri Jan 26 10:05:21 2018 -0800

    Add checksum for test_consistency (#9570)
---
 tests/python/gpu/test_forward.py | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/tests/python/gpu/test_forward.py b/tests/python/gpu/test_forward.py
index cddf9af..793ad54 100644
--- a/tests/python/gpu/test_forward.py
+++ b/tests/python/gpu/test_forward.py
@@ -19,6 +19,7 @@ import os
 import numpy as np
 import mxnet as mx
 from mxnet.test_utils import *
+from mxnet.gluon import utils
 
 def _get_model():
     if not os.path.exists('model/Inception-7-symbol.json'):
@@ -41,8 +42,19 @@ def _dump_images(shape):
     np.save('data/test_images_%d_%d.npy'%shape, imgs)
 
 def _get_data(shape):
-    download("http://data.mxnet.io/data/test_images_%d_%d.npy" % (shape), dirname='data')
-    download("http://data.mxnet.io/data/inception-v3-dump.npz", dirname="data")
+    hash_test_img = "355e15800642286e7fe607d87c38aeeab085b0cc"
+    hash_inception_v3 = "91807dfdbd336eb3b265dd62c2408882462752b9"
+    fname = utils.download("http://data.mxnet.io/data/test_images_%d_%d.npy" % (shape),
+                           path="data/test_images_%d_%d.npy" % (shape),
+                           sha1_hash=hash_test_img)
+    if not utils.check_sha1(fname, hash_test_img):
+        raise RuntimeError("File %s not downloaded completely" % ("test_images_%d_%d.npy"%(shape)))
+
+    fname = utils.download("http://data.mxnet.io/data/inception-v3-dump.npz",
+                           path='data/inception-v3-dump.npz',
+                           sha1_hash=hash_inception_v3)
+    if not utils.check_sha1(fname, hash_inception_v3):
+        raise RuntimeError("File %s not downloaded completely" % ("inception-v3-dump.npz"))
 
 def test_consistency(dump=False):
     shape = (299, 299)

-- 
To stop receiving notification emails like this one, please contact
jxie@apache.org.