Skip to content

Commit c1de126

Browse files
committedMay 14, 2020
fix(//py): Build system issues
Signed-off-by: Naren Dasan <naren@narendasan.com> Signed-off-by: Naren Dasan <narens@nvidia.com>
1 parent 7088245 commit c1de126

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed
 

‎py/setup.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
from setuptools import setup, Extension, find_packages
2-
from setuptools.command.build_ext import build_ext
1+
import os
32
import sys
43
import setuptools
5-
import os
4+
from setuptools import setup, Extension, find_packages
5+
from setuptools.command.build_ext import build_ext
6+
from setuptools.command.develop import develop
7+
from setuptools.command.install import install
8+
from distutils.cmd import Command
9+
610
from torch.utils import cpp_extension
711
from shutil import copyfile
812

@@ -27,7 +31,6 @@ def copy_libtrtorch():
2731

2832
class DevelopCommand(develop):
2933
description = "Builds the package and symlinks it into the PYTHONPATH"
30-
user_options = develop.user_options + plugins_user_options
3134

3235
def initialize_options(self):
3336
develop.initialize_options(self)
@@ -43,7 +46,6 @@ def run(self):
4346

4447
class InstallCommand(install):
4548
description = "Builds the package"
46-
user_options = install.user_options + plugins_user_options
4749

4850
def initialize_options(self):
4951
install.initialize_options(self)

‎py/trtorch/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _load_trtorch_lib():
1616
_load_trtorch_lib()
1717

1818
from .version import __version__
19-
#from trtorch import _C
19+
from trtorch import _C
2020
from trtorch.compiler import *
2121
from trtorch.types import *
2222

‎py/trtorch/csrc/trtorch_py.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ struct ExtraInfo {
108108

109109
torch::jit::Module CompileGraph(const torch::jit::Module& mod, ExtraInfo& info) {
110110
py::gil_scoped_acquire gil;
111-
auto trt_mod = trtorch::CompileGraph(mod, info.toInternalExtraInfo());
111+
auto trt_mod = core::CompileGraph(mod, info.toInternalExtraInfo());
112112
return trt_mod;
113113
}
114114

@@ -139,8 +139,8 @@ PYBIND11_MODULE(_C, m) {
139139
.def_readwrite("max", &InputRange::max)
140140
.def("_to_internal_input_range", &InputRange::toInternalInputRange);
141141

142-
py::class_<core::conversion::InputRange>(m, "_InternalInputRange")
143-
.def(py::init<>());
142+
//py::class_<core::conversion::InputRange>(m, "_InternalInputRange")
143+
// .def(py::init<>());
144144

145145
py::enum_<DataType>(m, "dtype")
146146
.value("float", DataType::kFloat)
@@ -176,10 +176,10 @@ PYBIND11_MODULE(_C, m) {
176176
.def_readwrite("max_batch_size", &ExtraInfo::max_batch_size);
177177

178178
m.doc() = "TRTorch Internal C Bindings: Ahead of Time compilation for PyTorch JIT. A tool to convert PyTorch JIT to TensorRT";
179-
m.def("_compile_graph", &trtorch::pyapi::CompileGraph, "Ingest a PyTorch JIT module and convert supported subgraphs to TensorRT engines, returns a JIT module with the engines embedded");
179+
m.def("_compile_graph", &trtorch::pyapi::CompileGraph, "Ingest a PyTorch JIT module and convert supported subgraphs to TensorRT engines, returns a JIT module with the engines embedded");
180180
m.def("_convert_graph_to_trt_engine", &trtorch::pyapi::ConvertGraphToTRTEngine, "Given a PyTorch JIT Module, convert forward into a TensorRT engine and return a serialized engine");
181-
m.def("_check_method_op_support", &trtorch::pyapi::CheckMethodOperatorSupport, "Takes a module and a method name and checks if the method graph contains purely convertable operators");
182-
m.def("_get_build_info", &get_build_info, "Returns build info about the compiler as a string");
181+
m.def("_check_method_op_support", &trtorch::pyapi::CheckMethodOperatorSupport, "Takes a module and a method name and checks if the method graph contains purely convertable operators");
182+
m.def("_get_build_info", &get_build_info, "Returns build info about the compiler as a string");
183183
m.def("_test", &test);
184184
}
185185

0 commit comments

Comments
 (0)
Please sign in to comment.