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
9a1043e1
You need to sign in or sign up before continuing.
Commit
9a1043e1
authored
Dec 05, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt to msgpack change in
https://github.com/msgpack/msgpack-python/issues/295
parent
7158eede
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
tensorpack/dataflow/common.py
tensorpack/dataflow/common.py
+2
-2
tensorpack/dataflow/parallel_map.py
tensorpack/dataflow/parallel_map.py
+4
-2
tensorpack/utils/serialize.py
tensorpack/utils/serialize.py
+3
-1
No files found.
tensorpack/dataflow/common.py
View file @
9a1043e1
...
...
@@ -287,7 +287,7 @@ class MapData(ProxyDataFlow):
Args:
ds (DataFlow): input DataFlow
func (datapoint -> datapoint | None): takes a datapoint and returns a new
datapoint. Return None to discard this datapoint.
datapoint. Return None to discard
/skip
this datapoint.
"""
super
(
MapData
,
self
)
.
__init__
(
ds
)
self
.
func
=
func
...
...
@@ -321,7 +321,7 @@ class MapDataComponent(MapData):
Args:
ds (DataFlow): input DataFlow which produces either list or dict.
func (TYPE -> TYPE|None): takes ``dp[index]``, returns a new value for ``dp[index]``.
return None to discard
this datapoint.
Return None to discard/skip
this datapoint.
index (int or str): index or key of the component.
"""
self
.
_index
=
index
...
...
tensorpack/dataflow/parallel_map.py
View file @
9a1043e1
...
...
@@ -149,7 +149,8 @@ class MultiThreadMapData(_ParallelMapData):
Args:
ds (DataFlow): the dataflow to map
nr_thread (int): number of threads to use
map_func (callable): datapoint -> datapoint | None
map_func (callable): datapoint -> datapoint | None. Return None to
discard/skip the datapoint.
buffer_size (int): number of datapoints in the buffer
strict (bool): use "strict mode", see notes above.
"""
...
...
@@ -250,7 +251,8 @@ class MultiProcessMapDataZMQ(_ParallelMapData, _MultiProcessZMQDataFlow):
Args:
ds (DataFlow): the dataflow to map
nr_proc(int): number of threads to use
map_func (callable): datapoint -> datapoint | None
map_func (callable): datapoint -> datapoint | None. Return None to
discard/skip the datapoint.
buffer_size (int): number of datapoints in the buffer
strict (bool): use "strict mode", see notes above.
"""
...
...
tensorpack/utils/serialize.py
View file @
9a1043e1
...
...
@@ -24,7 +24,9 @@ def loads_msgpack(buf):
Args:
buf: the output of `dumps`.
"""
return
msgpack
.
loads
(
buf
,
raw
=
False
)
# Since 0.6, the default max size was set to 1MB.
# We change it to approximately 1G.
return
msgpack
.
loads
(
buf
,
raw
=
False
,
max_bin_len
=
1000000000
)
def
dumps_pyarrow
(
obj
):
...
...
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