You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ns...@apache.org on 2018/11/04 17:27:37 UTC

[incubator-mxnet] branch master updated: Update module example (#12961)

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

nswamy 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 976fd00  Update module example (#12961)
976fd00 is described below

commit 976fd00d96bdc0e09ea226a8ce6f76bc4707f903
Author: Thomas Delteil <th...@gmail.com>
AuthorDate: Sun Nov 4 09:27:18 2018 -0800

    Update module example (#12961)
    
    * Update Module example
    
    * trigger CI
---
 example/{ => module}/utils/__init__.py | 0
 example/{ => module}/utils/get_data.py | 6 +++---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/example/utils/__init__.py b/example/module/utils/__init__.py
similarity index 100%
rename from example/utils/__init__.py
rename to example/module/utils/__init__.py
diff --git a/example/utils/get_data.py b/example/module/utils/get_data.py
similarity index 94%
rename from example/utils/get_data.py
rename to example/module/utils/get_data.py
index 861d16c..2a585ea 100644
--- a/example/utils/get_data.py
+++ b/example/module/utils/get_data.py
@@ -17,6 +17,7 @@
 
 import os
 import mxnet as mx
+import zipfile
 
 def get_mnist(data_dir):
     if not os.path.isdir(data_dir):
@@ -28,7 +29,7 @@ def get_mnist(data_dir):
        (not os.path.exists('t10k-labels-idx1-ubyte')):
         import urllib, zipfile
         zippath = os.path.join(os.getcwd(), "mnist.zip")
-        urllib.urlretrieve("http://data.mxnet.io/mxnet/data/mnist.zip", zippath)
+        mx.test_utils.download("http://data.mxnet.io/mxnet/data/mnist.zip", zippath)
         zf = zipfile.ZipFile(zippath, "r")
         zf.extractall()
         zf.close()
@@ -45,7 +46,7 @@ def get_cifar10(data_dir):
         import urllib, zipfile, glob
         dirname = os.getcwd()
         zippath = os.path.join(dirname, "cifar10.zip")
-        urllib.urlretrieve("http://data.mxnet.io/mxnet/data/cifar10.zip", zippath)
+        mx.test_utils.download("http://data.mxnet.io/mxnet/data/cifar10.zip", zippath)
         zf = zipfile.ZipFile(zippath, "r")
         zf.extractall()
         zf.close()
@@ -56,7 +57,6 @@ def get_cifar10(data_dir):
         os.rmdir(os.path.join(dirname, "cifar"))
     os.chdir(cwd)
 
-# data
 def get_cifar10_iterator(args, kv):
     data_shape = (3, 28, 28)
     data_dir = args.data_dir