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
bf6402ad
Commit
bf6402ad
authored
Jul 03, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix nested argscope (fix #1252)
parent
7e7e577f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
docs/tutorial/philosophy/dataflow.md
docs/tutorial/philosophy/dataflow.md
+1
-0
tensorpack/tfutils/argscope.py
tensorpack/tfutils/argscope.py
+2
-1
No files found.
docs/tutorial/philosophy/dataflow.md
View file @
bf6402ad
...
@@ -161,6 +161,7 @@ or when you need to filter your data on the fly.
...
@@ -161,6 +161,7 @@ or when you need to filter your data on the fly.
but inefficient for generic data type or numpy arrays.
but inefficient for generic data type or numpy arrays.
Also, its implementation
[
does not always clean up the subprocesses correctly
](
https://github.com/pytorch/pytorch/issues/16608
)
.
Also, its implementation
[
does not always clean up the subprocesses correctly
](
https://github.com/pytorch/pytorch/issues/16608
)
.
Pytorch starts to improve on these bad assumptions (e.g., with
[
IterableDataset
](
https://github.com/pytorch/pytorch/pull/19228
)
).
On the other hand, DataFlow:
On the other hand, DataFlow:
1.
Is a pure iterator, not necessarily has a length or can be indexed. This is more generic.
1.
Is a pure iterator, not necessarily has a length or can be indexed. This is more generic.
...
...
tensorpack/tfutils/argscope.py
View file @
bf6402ad
...
@@ -49,7 +49,8 @@ def argscope(layers, **kwargs):
...
@@ -49,7 +49,8 @@ def argscope(layers, **kwargs):
assert
hasattr
(
l
,
'symbolic_function'
),
"{} is not a registered layer"
.
format
(
l
.
__name__
)
assert
hasattr
(
l
,
'symbolic_function'
),
"{} is not a registered layer"
.
format
(
l
.
__name__
)
# _check_args_exist(l.symbolic_function)
# _check_args_exist(l.symbolic_function)
new_scope
=
copy
.
copy
(
get_arg_scope
())
# need to deepcopy so that changes to new_scope does not affect outer scope
new_scope
=
copy
.
deepcopy
(
get_arg_scope
())
for
l
in
layers
:
for
l
in
layers
:
new_scope
[
l
.
__name__
]
.
update
(
kwargs
)
new_scope
[
l
.
__name__
]
.
update
(
kwargs
)
_ArgScopeStack
.
append
(
new_scope
)
_ArgScopeStack
.
append
(
new_scope
)
...
...
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