Skip to content

Commit

Permalink
Fix for undefined variable errors (apache#12037)
Browse files Browse the repository at this point in the history
* Undefined name in initializer

* Fix undefined name in test_mkldnn

* Fix for undefined names in examples
  • Loading branch information
vandanavk authored and sandeep-krishnamurthy committed Aug 8, 2018
1 parent e0ee31a commit eb80b8d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion example/rnn/word_lm/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
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

Expand Down
2 changes: 1 addition & 1 deletion example/sparse/factorization_machine/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions example/sparse/wide_deep/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion tests/python/mkl/test_mkldnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
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
Expand Down Expand Up @@ -261,4 +262,4 @@ def check_fullyconnected_training(stype):


if __name__ == '__main__':
test_mkldnn_install()
install.test_mkldnn_install()

0 comments on commit eb80b8d

Please sign in to comment.