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
79711478
Commit
79711478
authored
Aug 27, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing file from last commit
parent
805c44d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
tensorpack/utils/compatible_serialize.py
tensorpack/utils/compatible_serialize.py
+20
-0
No files found.
tensorpack/utils/compatible_serialize.py
0 → 100755
View file @
79711478
#!/usr/bin/env python
import
os
from
.serialize
import
loads_msgpack
,
loads_pyarrow
,
dumps_msgpack
,
dumps_pyarrow
"""
Serialization that has compatibility guarantee (therefore is safe to store to disk).
"""
__all__
=
[
'loads'
,
'dumps'
]
# pyarrow has no compatibility guarantee
# use msgpack for persistent serialization, unless explicitly set from envvar
if
os
.
environ
.
get
(
'TENSORPACK_COMPATIBLE_SERIALIZE'
,
'msgpack'
)
==
'msgpack'
:
loads
=
loads_msgpack
dumps
=
dumps_msgpack
else
:
loads
=
loads_pyarrow
dumps
=
dumps_pyarrow
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