Skip to content

Commit 75d6cbe

Browse files
qihqipytorchmergebot
authored andcommitted
[4/5]Testing jit module in flatbuffer in Python. (#74387)
Summary: Pull Request resolved: #74387 Make temporary python bindings for flatbuffer to test ScriptModule save / load. (Note: this ignores all push blocking failures!) Test Plan: unittest Reviewed By: iseeyuan Differential Revision: D34968080 fbshipit-source-id: d23b16abda6e4b7ecf6b1198ed6e00908a3db903 (cherry picked from commit 5cbbc39)
1 parent 11894db commit 75d6cbe

File tree

13 files changed

+679
-33
lines changed

13 files changed

+679
-33
lines changed

setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,16 @@ def make_relative_rpath_args(path):
824824
include_dirs=[],
825825
library_dirs=library_dirs,
826826
extra_link_args=extra_link_args + main_link_args + make_relative_rpath_args('lib'))
827+
C_flatbuffer = Extension("torch._C_flatbuffer",
828+
libraries=main_libraries,
829+
sources=["torch/csrc/stub_with_flatbuffer.c"],
830+
language='c',
831+
extra_compile_args=main_compile_args + extra_compile_args,
832+
include_dirs=[],
833+
library_dirs=library_dirs,
834+
extra_link_args=extra_link_args + main_link_args + make_relative_rpath_args('lib'))
827835
extensions.append(C)
836+
extensions.append(C_flatbuffer)
828837

829838
if not IS_WINDOWS:
830839
DL = Extension("torch._dl",
@@ -932,6 +941,7 @@ def print_box(msg):
932941
'bin/*',
933942
'test/*',
934943
'_C/*.pyi',
944+
'_C_flatbuffer/*.pyi',
935945
'cuda/*.pyi',
936946
'optim/*.pyi',
937947
'autograd/*.pyi',

0 commit comments

Comments
 (0)