Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
07c1807a
Commit
07c1807a
authored
Feb 21, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix import (fix #653)
parent
b5be9481
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
tensorpack/utils/serialize.py
tensorpack/utils/serialize.py
+8
-9
No files found.
tensorpack/utils/serialize.py
View file @
07c1807a
...
@@ -2,23 +2,22 @@
...
@@ -2,23 +2,22 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# File: serialize.py
# File: serialize.py
import
sys
import
msgpack
import
msgpack
import
msgpack_numpy
import
msgpack_numpy
msgpack_numpy
.
patch
()
msgpack_numpy
.
patch
()
# https://github.com/apache/arrow/pull/1223#issuecomment-359895666
old_mod
=
sys
.
modules
.
get
(
'torch'
,
None
)
sys
.
modules
[
'torch'
]
=
None
try
:
try
:
# https://github.com/apache/arrow/pull/1223#issuecomment-359895666
import
sys
old_mod
=
sys
.
modules
.
get
(
'torch'
,
None
)
sys
.
modules
[
'torch'
]
=
None
import
pyarrow
as
pa
import
pyarrow
as
pa
if
old_mod
is
not
None
:
sys
.
modules
[
'torch'
]
=
old_mod
else
:
del
sys
.
modules
[
'torch'
]
except
ImportError
:
except
ImportError
:
pa
=
None
pa
=
None
if
old_mod
is
not
None
:
sys
.
modules
[
'torch'
]
=
old_mod
else
:
del
sys
.
modules
[
'torch'
]
__all__
=
[
'loads'
,
'dumps'
]
__all__
=
[
'loads'
,
'dumps'
]
...
...
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