• Xavier Bouthillier's avatar
    replace `from .nnet import *` · 28c56939
    Xavier Bouthillier 提交于
    ```from .nnet import *``` in ```theano/tensor/nnet/__init__.py``` is
    causing problems because ```nnet``` imports ```theano.tensor.opt``` as
    ```opt``` which takes namespace place of ```theano.tensor.nnet.opt```.
    
    To fix this problem, I replace ```from .nnet import *``` by ```from
    .nnet import (every class/functions/attributes)```
    
    Added the following code at the end of the file
    ```theano/tensor/nnet/nnet.py```
    
    ```python
    print locals().keys()
    ```
    
    And then copied the output
    
    ```bash
    $ python theano/tensor/nnet/nnet.py
    ['keys', 'of', 'locals', ...]
    ```
    
    Removed last line of code in ```theano/tensor/nnet/nnet.py``` and added
    following code under the imports
    
    ```python
    keys = ['keys', 'of', 'locals', ...]  # pasted the copied output from
    previous step
    local_keys = locals().keys()
    keep = filter(lambda a: a not in local_keys and a[0] != '_', keys)
    print sorted(keep)
    ```
    And again
    
    ```bash
    $ python theano/tensor/nnet/nnet.py
    ['keys', 'of', 'locals', 'minus', 'imports', 'and', 'private'...]
    ```
    
    Those are the class/function names to be added to
    ```theano/tensor/nnet/__init__.py```.
    
    ```python
    from .nnet import (
        keys, of, locals, minus, imports,
        and, private, ...)
    ```
    28c56939
名称
最后提交
最后更新
benchmark 正在载入提交数据...
bin 正在载入提交数据...
doc 正在载入提交数据...
theano 正在载入提交数据...
.gitignore 正在载入提交数据...
.mailmap 正在载入提交数据...
.travis.yml 正在载入提交数据...
DESCRIPTION.txt 正在载入提交数据...
EMAIL.txt 正在载入提交数据...
HISTORY.txt 正在载入提交数据...
LICENSE.txt 正在载入提交数据...
MANIFEST.in 正在载入提交数据...
NEWS.txt 正在载入提交数据...
NEWS_DEV.txt 正在载入提交数据...
README.txt 正在载入提交数据...
Theano.pyproj 正在载入提交数据...
Theano.sln 正在载入提交数据...
requirement-rtd.txt 正在载入提交数据...
setup.cfg 正在载入提交数据...
setup.py 正在载入提交数据...