Skip to content

Commit 80ed795

Browse files
committed
Minor ffi utils fix
1 parent a2938e3 commit 80ed795

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

torch/utils/ffi/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ def create_extension(name, headers, sources, verbose=True, with_cuda=False,
138138
if not package:
139139
cffi_wrapper_name = '_' + name_suffix
140140
else:
141-
cffi_wrapper_name = name.rpartition('.')[0] + '._' + name_suffix
141+
cffi_wrapper_name = (name.rpartition('.')[0] +
142+
'.{0}._{0}'.format(name_suffix))
142143

143144
wrapper_source, include_dirs = _setup_wrapper(with_cuda)
144145
include_dirs.extend(kwargs.pop('include_dirs', []))
@@ -155,7 +156,7 @@ def create_extension(name, headers, sources, verbose=True, with_cuda=False,
155156
ffi.set_source(cffi_wrapper_name, wrapper_source + all_headers_source,
156157
sources=sources,
157158
include_dirs=include_dirs, **kwargs)
158-
ffi.cdef(_typedefs + all_headers_source);
159+
ffi.cdef(_typedefs + all_headers_source)
159160

160161
_make_python_wrapper(name_suffix, '_' + name_suffix, target_dir)
161162
def build():

0 commit comments

Comments
 (0)