You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by sk...@apache.org on 2018/08/08 15:24:38 UTC

[incubator-mxnet] branch master updated: Fix for undefined variable errors (#12037)

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

skm 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 edc28af  Fix for undefined variable errors (#12037)
edc28af is described below

commit edc28af1a20f78e9399f4fab706e33e6b59a4ce0
Author: Vandana Kannan <va...@users.noreply.github.com>
AuthorDate: Wed Aug 8 08:24:28 2018 -0700

    Fix for undefined variable errors (#12037)
    
    * Undefined name in initializer
    
    * Fix undefined name in test_mkldnn
    
    * Fix for undefined names in examples
---
 example/rnn/word_lm/train.py                  | 2 +-
 example/sparse/factorization_machine/train.py | 2 +-
 example/sparse/wide_deep/train.py             | 4 ++--
 python/mxnet/initializer.py                   | 2 +-
 tests/python/mkl/test_mkldnn.py               | 3 ++-
 5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/example/rnn/word_lm/train.py b/example/rnn/word_lm/train.py
index aa64135..c48fe80 100644
--- a/example/rnn/word_lm/train.py
+++ b/example/rnn/word_lm/train.py
@@ -20,7 +20,7 @@ import mxnet as mx, math
 import argparse, math
 import logging
 from data import Corpus, CorpusIter
-from model import *
+from model import rnn, softmax_ce_loss
 from module import *
 from mxnet.model import BatchEndParam
 
diff --git a/example/sparse/factorization_machine/train.py b/example/sparse/factorization_machine/train.py
index c73ce88..b30f9cc 100644
--- a/example/sparse/factorization_machine/train.py
+++ b/example/sparse/factorization_machine/train.py
@@ -18,7 +18,7 @@
 import mxnet as mx
 from metric import *
 from mxnet.test_utils import *
-from model import *
+from model import factorization_machine_model
 import argparse, os
 
 parser = argparse.ArgumentParser(description="Run factorization machine with criteo dataset",
diff --git a/example/sparse/wide_deep/train.py b/example/sparse/wide_deep/train.py
index 89befb5..6fd81b7 100644
--- a/example/sparse/wide_deep/train.py
+++ b/example/sparse/wide_deep/train.py
@@ -17,8 +17,8 @@
 
 import mxnet as mx
 from mxnet.test_utils import *
-from data import *
-from model import *
+from data import get_uci_adult
+from model import wide_deep_model
 import argparse
 import os
 
diff --git a/python/mxnet/initializer.py b/python/mxnet/initializer.py
index ef9026d..8ae729f 100755
--- a/python/mxnet/initializer.py
+++ b/python/mxnet/initializer.py
@@ -697,7 +697,7 @@ class FusedRNN(Initializer):
     def __init__(self, init, num_hidden, num_layers, mode, bidirectional=False, forget_bias=1.0):
         if isinstance(init, string_types):
             klass, kwargs = json.loads(init)
-            init = _INITIALIZER_REGISTRY[klass.lower()](**kwargs)
+            init = registry._REGISTRY[klass.lower()](**kwargs)
         super(FusedRNN, self).__init__(init=init.dumps() if init is not None else None,
                                        num_hidden=num_hidden, num_layers=num_layers, mode=mode,
                                        bidirectional=bidirectional, forget_bias=forget_bias)
diff --git a/tests/python/mkl/test_mkldnn.py b/tests/python/mkl/test_mkldnn.py
index ff9ba53..03f3c76 100644
--- a/tests/python/mkl/test_mkldnn.py
+++ b/tests/python/mkl/test_mkldnn.py
@@ -26,6 +26,7 @@ from mxnet.test_utils import rand_ndarray, assert_almost_equal
 from mxnet import gluon
 from mxnet.gluon import nn
 from mxnet.test_utils import *
+import test_mkldnn_install as install
 curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
 sys.path.append(os.path.join(curr_path, '../unittest/'))
 from common import with_seed
@@ -261,4 +262,4 @@ def test_fullyconnected():
 
 
 if __name__ == '__main__':
-    test_mkldnn_install()
+    install.test_mkldnn_install()