{"push_id":812785840,"size":1,"distinct_size":1,"ref":"refs/heads/fix_import","head":"3e81b89cbf88f4b39cacbcd8fbb2cead595f99c2","before":"de2f02e148408f41003e97413154d320573d6e7e","commits":[{"sha":"3e81b89cbf88f4b39cacbcd8fbb2cead595f99c2","author":{"email":"666ae3c413b2afebe6b1b5cf126cec50a3ac192d@umontreal.ca","name":"Xavier Bouthillier"},"message":"replace `from .nnet import *`\n\n```from .nnet import *``` in ```theano/tensor/nnet/__init__.py``` is\ncausing problems because ```nnet``` imports ```theano.tensor.opt``` as\n```opt``` which takes namespace place of ```theano.tensor.nnet.opt```.\n\nTo fix this problem, I replace ```from .nnet import *``` by ```from\n.nnet import (every class/functions/attributes)```\n\nAdded the following code at the end of the file\n```theano/tensor/nnet/nnet.py```\n\n```python\nprint locals().keys()\n```\n\nAnd then copied the output\n\n```bash\n$ python theano/tensor/nnet/nnet.py\n['keys', 'of', 'locals', ...]\n```\n\nRemoved last line of code in ```theano/tensor/nnet/nnet.py``` and added\nfollowing code under the imports\n\n```python\nkeys = ['keys', 'of', 'locals', ...]  # pasted the copied output from\nprevious step\nlocal_keys = locals().keys()\nkeep = filter(lambda a: a not in local_keys and a[0] != '_', keys)\nprint sorted(keep)\n```\nAnd again\n\n```bash\n$ python theano/tensor/nnet/nnet.py\n['keys', 'of', 'locals', 'minus', 'imports', 'and', 'private'...]\n```\n\nThose are the class/function names to be added to\n```theano/tensor/nnet/__init__.py```.\n\n```python\nfrom .nnet import (\n    keys, of, locals, minus, imports,\n    and, private, ...)\n```","distinct":true,"url":"https://api.github.com/repos/bouthilx/Theano/commits/3e81b89cbf88f4b39cacbcd8fbb2cead595f99c2"}]}