Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
3pia
CMS Analyses
Tools
Commits
b88d0281
Commit
b88d0281
authored
3 years ago
by
Dennis Noll
Browse files
Options
Downloads
Patches
Plain Diff
[data] DSS: map now supports tqdm status bar
parent
44e942b7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
data.py
+5
-2
5 additions, 2 deletions
data.py
with
5 additions
and
2 deletions
data.py
+
5
−
2
View file @
b88d0281
...
...
@@ -4,6 +4,8 @@ import tensorflow as tf
from
operator
import
itemgetter
from
os
import
listdir
,
path
,
remove
from
tqdm.auto
import
tqdm
class
SKDict
(
dict
):
@staticmethod
...
...
@@ -56,10 +58,11 @@ class SKDict(dict):
def
copy
(
self
):
return
self
.
__class__
(
self
)
def
map
(
self
,
func
,
groups
=
None
):
def
map
(
self
,
func
,
groups
=
None
,
**
tqdm_kwargs
):
if
groups
is
None
:
groups
=
self
.
keys
()
return
self
.
__class__
({
g
:
func
(
self
[
g
])
for
g
in
map
(
self
.
keyify
,
groups
)})
wrap
=
lambda
x
:
tqdm
(
x
,
**
tqdm_kwargs
)
if
tqdm_kwargs
else
lambda
x
:
x
return
self
.
__class__
({
g
:
func
(
self
[
g
])
for
g
in
map
(
self
.
keyify
,
wrap
(
groups
))})
@classmethod
def
zip
(
cls
,
*
insts
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment