Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
bd44fe03
Commit
bd44fe03
authored
Dec 01, 2018
by
lihaozhehw
Committed by
Tianqi Chen
Nov 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Python security issue about mktemp() and abspath() (#2202)
parent
6d32037c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
10 deletions
+10
-10
python/tvm/_ffi/libinfo.py
+2
-2
python/tvm/contrib/debugger/debug_runtime.py
+1
-1
python/tvm/contrib/nvcc.py
+1
-1
python/tvm/contrib/verilog.py
+2
-2
python/tvm/contrib/xcode.py
+2
-2
python/tvm/exec/rpc_proxy.py
+1
-1
topi/python/topi/cpp.py
+1
-1
No files found.
python/tvm/_ffi/libinfo.py
View file @
bd44fe03
...
...
@@ -25,7 +25,7 @@ def find_lib_path(name=None, search_path=None, optional=False):
# inplace) or the install directory (if TVM is installed).
# An installed TVM's curr_path will look something like:
# $PREFIX/lib/python3.6/site-packages/tvm/_ffi
ffi_dir
=
os
.
path
.
dirname
(
os
.
path
.
abs
path
(
os
.
path
.
expanduser
(
__file__
)))
ffi_dir
=
os
.
path
.
dirname
(
os
.
path
.
real
path
(
os
.
path
.
expanduser
(
__file__
)))
source_dir
=
os
.
path
.
join
(
ffi_dir
,
".."
,
".."
,
".."
)
install_lib_dir
=
os
.
path
.
join
(
ffi_dir
,
".."
,
".."
,
".."
,
".."
)
...
...
@@ -49,7 +49,7 @@ def find_lib_path(name=None, search_path=None, optional=False):
dll_path
.
append
(
install_lib_dir
)
dll_path
=
[
os
.
path
.
abs
path
(
x
)
for
x
in
dll_path
]
dll_path
=
[
os
.
path
.
real
path
(
x
)
for
x
in
dll_path
]
if
search_path
is
not
None
:
if
search_path
is
list
:
dll_path
=
dll_path
+
search_path
...
...
python/tvm/contrib/debugger/debug_runtime.py
View file @
bd44fe03
...
...
@@ -146,7 +146,7 @@ class GraphModuleDebug(graph_runtime.GraphModule):
"""
# make the dump folder if not given
if
not
self
.
_dump_root
:
self
.
_dump_root
=
tempfile
.
mktemp
(
prefix
=
_DUMP_ROOT_PREFIX
)
self
.
_dump_root
=
tempfile
.
mk
d
temp
(
prefix
=
_DUMP_ROOT_PREFIX
)
# format the context
ctx
=
self
.
_format_context
(
ctx
)
...
...
python/tvm/contrib/nvcc.py
View file @
bd44fe03
...
...
@@ -103,7 +103,7 @@ def find_cuda_path():
(
out
,
_
)
=
proc
.
communicate
()
out
=
py_str
(
out
)
if
proc
.
returncode
==
0
:
return
os
.
path
.
abs
path
(
os
.
path
.
join
(
str
(
out
)
.
strip
(),
"../.."
))
return
os
.
path
.
real
path
(
os
.
path
.
join
(
str
(
out
)
.
strip
(),
"../.."
))
cuda_path
=
"/usr/local/cuda"
if
os
.
path
.
exists
(
os
.
path
.
join
(
cuda_path
,
"bin/nvcc"
)):
return
cuda_path
...
...
python/tvm/contrib/verilog.py
View file @
bd44fe03
...
...
@@ -111,7 +111,7 @@ class VPIHandle(NodeBase):
def
_find_vpi_path
():
curr_path
=
os
.
path
.
dirname
(
os
.
path
.
abs
path
(
os
.
path
.
expanduser
(
__file__
)))
curr_path
=
os
.
path
.
dirname
(
os
.
path
.
real
path
(
os
.
path
.
expanduser
(
__file__
)))
api_path
=
os
.
path
.
join
(
curr_path
,
'../../../lib/'
)
vpi_path
=
[
curr_path
,
api_path
]
vpi_path
=
[
os
.
path
.
join
(
p
,
'tvm_vpi.vpi'
)
for
p
in
vpi_path
]
...
...
@@ -123,7 +123,7 @@ def _find_vpi_path():
def
search_path
():
"""Get the search directory."""
curr_path
=
os
.
path
.
dirname
(
os
.
path
.
abs
path
(
os
.
path
.
expanduser
(
__file__
)))
curr_path
=
os
.
path
.
dirname
(
os
.
path
.
real
path
(
os
.
path
.
expanduser
(
__file__
)))
ver_path
=
[
os
.
path
.
join
(
curr_path
,
'../../../verilog/'
)]
ver_path
+=
[
os
.
path
.
join
(
curr_path
,
'../../../tests/verilog/unittest/'
)]
ver_path
+=
[
os
.
path
.
join
(
curr_path
,
'../../../tests/verilog/integration/'
)]
...
...
python/tvm/contrib/xcode.py
View file @
bd44fe03
...
...
@@ -206,9 +206,9 @@ def popen_test_rpc(host,
if
"TVM_IOS_RPC_ROOT"
in
os
.
environ
:
rpc_root
=
os
.
environ
[
"TVM_IOS_RPC_ROOT"
]
else
:
curr_path
=
os
.
path
.
dirname
(
os
.
path
.
abs
path
(
os
.
path
.
expanduser
(
__file__
)))
curr_path
=
os
.
path
.
dirname
(
os
.
path
.
real
path
(
os
.
path
.
expanduser
(
__file__
)))
rpc_root
=
os
.
path
.
join
(
curr_path
,
"../../../apps/ios_rpc"
)
proj_path
=
os
.
path
.
abs
path
(
os
.
path
.
join
(
rpc_root
,
"tvmrpc.xcodeproj"
))
proj_path
=
os
.
path
.
real
path
(
os
.
path
.
join
(
rpc_root
,
"tvmrpc.xcodeproj"
))
if
not
os
.
path
.
exists
(
proj_path
):
raise
RuntimeError
(
"Cannot find tvmrpc.xcodeproj in
%
s,"
+
(
" please set env TVM_IOS_RPC_ROOT correctly"
%
rpc_root
))
...
...
python/tvm/exec/rpc_proxy.py
View file @
bd44fe03
...
...
@@ -12,7 +12,7 @@ from ..rpc.proxy import Proxy
def
find_example_resource
():
"""Find resource examples."""
curr_path
=
os
.
path
.
dirname
(
os
.
path
.
abs
path
(
os
.
path
.
expanduser
(
__file__
)))
curr_path
=
os
.
path
.
dirname
(
os
.
path
.
real
path
(
os
.
path
.
expanduser
(
__file__
)))
base_path
=
os
.
path
.
join
(
curr_path
,
"../../../"
)
index_page
=
os
.
path
.
join
(
base_path
,
"web/example_rpc.html"
)
js_files
=
[
...
...
topi/python/topi/cpp.py
View file @
bd44fe03
...
...
@@ -15,7 +15,7 @@ def _get_lib_names():
def
_load_lib
():
"""Load libary by searching possible path."""
curr_path
=
os
.
path
.
dirname
(
os
.
path
.
abs
path
(
os
.
path
.
expanduser
(
__file__
)))
curr_path
=
os
.
path
.
dirname
(
os
.
path
.
real
path
(
os
.
path
.
expanduser
(
__file__
)))
lib_search
=
curr_path
lib_path
=
libinfo
.
find_lib_path
(
_get_lib_names
(),
lib_search
,
optional
=
True
)
if
lib_path
is
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment