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())
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
:EDIT: I'm opening a PR against https://github.com/SeanNaren/warp-ctc/pull/17.