SeanNaren / warp-ctc

Pytorch Bindings for warp-ctc
Apache License 2.0
757 stars 271 forks source link

Remove auto-generated parts from __init__.py #27

Closed r9y9 closed 6 years ago

r9y9 commented 6 years ago

This is causing error on python2. I confirmed this works on both python2 and python3.

fixes https://github.com/SeanNaren/warp-ctc/pull/12#issuecomment-370378898

Autogenrated warpctc_pytorch/_warp_ctc/__init__.py:

cat warpctc_pytorch/_warp_ctc/__init__.py
from torch.utils.ffi import _wrap_function
from .__warp_ctc import lib as _lib, ffi as _ffi

__all__ = []
def _import_symbols(locals):
    for symbol in dir(_lib):
        fn = getattr(_lib, symbol)
        if callable(fn):
            locals[symbol] = _wrap_function(fn, _ffi)
        else:
            locals[symbol] = fn
        __all__.append(symbol)

_import_symbols(locals())

EDIT: I'm opening a PR against https://github.com/SeanNaren/warp-ctc/pull/17.