Skip to content

Commit

Permalink
[4/5]Testing jit module in flatbuffer in Python. (pytorch#74387)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#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)
  • Loading branch information
qihqi authored and pytorchmergebot committed Mar 24, 2022
1 parent 11894db commit 75d6cbe
Show file tree
Hide file tree
Showing 13 changed files with 679 additions and 33 deletions.
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,16 @@ def make_relative_rpath_args(path):
include_dirs=[],
library_dirs=library_dirs,
extra_link_args=extra_link_args + main_link_args + make_relative_rpath_args('lib'))
C_flatbuffer = Extension("torch._C_flatbuffer",
libraries=main_libraries,
sources=["torch/csrc/stub_with_flatbuffer.c"],
language='c',
extra_compile_args=main_compile_args + extra_compile_args,
include_dirs=[],
library_dirs=library_dirs,
extra_link_args=extra_link_args + main_link_args + make_relative_rpath_args('lib'))
extensions.append(C)
extensions.append(C_flatbuffer)

if not IS_WINDOWS:
DL = Extension("torch._dl",
Expand Down Expand Up @@ -932,6 +941,7 @@ def print_box(msg):
'bin/*',
'test/*',
'_C/*.pyi',
'_C_flatbuffer/*.pyi',
'cuda/*.pyi',
'optim/*.pyi',
'autograd/*.pyi',
Expand Down
Loading

0 comments on commit 75d6cbe

Please sign in to comment.