Skip to content

Commit 58fbf12

Browse files
committed
changed the PATH in setup.py
Signed-off-by: Bo Wang <[email protected]>
1 parent f06735a commit 58fbf12

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

examples/custom_converters/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ import os
6464
from setuptools import setup, Extension
6565
from torch.utils import cpp_extension
6666
67-
dir_path = os.path.dirname(os.path.realpath(__file__))
6867
6968
# library_dirs should point to the libtrtorch.so, include_dirs should point to the dir that include the headers
7069
# 1) download the latest package from https://github.com/NVIDIA/TRTorch/releases/
7170
# 2) Extract the file from downloaded package, we will get the "trtorch" directory
7271
# 3) Set trtorch_path to that directory
73-
trtorch_path = os.path.abspath("trtorch")
72+
trtorch_path = <PATH TO TRTORCH>
73+
7474
7575
ext_modules = [
7676
cpp_extension.CUDAExtension('elu_converter', ['./csrc/elu_converter.cpp'],
@@ -120,7 +120,7 @@ class Elu(torch.nn.Module):
120120
return self.elu(x)
121121

122122

123-
def MaxDiff(pytorch_out, trtorch_out):
123+
def cal_max_diff(pytorch_out, trtorch_out):
124124
diff = torch.sub(pytorch_out, trtorch_out)
125125
abs_diff = torch.abs(diff)
126126
max_diff = torch.max(abs_diff)
@@ -148,7 +148,7 @@ def main():
148148
trtorch_out = trt_ts_module(input_data)
149149
print('PyTorch output: \n', pytorch_out[0, :, :, 0])
150150
print('TRTorch output: \n', trtorch_out[0, :, :, 0])
151-
MaxDiff(pytorch_out, trtorch_out)
151+
cal_max_diff(pytorch_out, trtorch_out)
152152

153153

154154
if __name__ == "__main__":

examples/custom_converters/elu_converter/setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
from setuptools import setup, Extension
33
from torch.utils import cpp_extension
44

5-
dir_path = os.path.dirname(os.path.realpath(__file__))
65

76
# library_dirs should point to the libtrtorch.so, include_dirs should point to the dir that include the headers
87
# 1) download the latest package from https://github.com/NVIDIA/TRTorch/releases/
98
# 2) Extract the file from downloaded package, we will get the "trtorch" directory
109
# 3) Set trtorch_path to that directory
11-
trtorch_path = os.path.abspath("/home/bowa/Downloads/trtorch")
10+
trtorch_path = <PATH TO TRTORCH>
1211

1312
ext_modules = [
1413
cpp_extension.CUDAExtension('elu_converter', ['./csrc/elu_converter.cpp'],

0 commit comments

Comments
 (0)