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
3827ccb5
Unverified
Commit
3827ccb5
authored
Jan 28, 2020
by
hlu1
Committed by
GitHub
Jan 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Python] Replace os.path.exists with try...except...else (#4784)
parent
9c383f64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
python/tvm/contrib/pickle_memoize.py
+5
-1
No files found.
python/tvm/contrib/pickle_memoize.py
View file @
3827ccb5
...
@@ -40,8 +40,12 @@ class Cache(object):
...
@@ -40,8 +40,12 @@ class Cache(object):
cache_by_key
=
{}
cache_by_key
=
{}
def
__init__
(
self
,
key
,
save_at_exit
):
def
__init__
(
self
,
key
,
save_at_exit
):
cache_dir
=
".pkl_memoize_py{0}"
.
format
(
sys
.
version_info
[
0
])
cache_dir
=
".pkl_memoize_py{0}"
.
format
(
sys
.
version_info
[
0
])
if
not
os
.
path
.
exists
(
cache_dir
)
:
try
:
os
.
mkdir
(
cache_dir
)
os
.
mkdir
(
cache_dir
)
except
FileExistsError
:
pass
else
:
self
.
cache
=
{}
self
.
path
=
os
.
path
.
join
(
cache_dir
,
key
)
self
.
path
=
os
.
path
.
join
(
cache_dir
,
key
)
if
os
.
path
.
exists
(
self
.
path
):
if
os
.
path
.
exists
(
self
.
path
):
try
:
try
:
...
...
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