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
78c7488e
Commit
78c7488e
authored
Nov 06, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing file
parent
740e9d8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
tensorpack/callbacks/dispatcher.py
tensorpack/callbacks/dispatcher.py
+29
-0
No files found.
tensorpack/callbacks/dispatcher.py
0 → 100644
View file @
78c7488e
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: dispatcher.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
from
..tfutils.common
import
get_op_tensor_name
__all__
=
[
'OutputTensorDispatcer'
]
class
OutputTensorDispatcer
(
object
):
def
__init__
(
self
):
self
.
_names
=
[]
self
.
_idxs
=
[]
def
add_entry
(
self
,
names
):
v
=
[]
for
n
in
names
:
tensorname
=
get_op_tensor_name
(
n
)[
1
]
if
tensorname
in
self
.
_names
:
v
.
append
(
self
.
_names
.
index
(
tensorname
))
else
:
self
.
_names
.
append
(
tensorname
)
v
.
append
(
len
(
self
.
_names
)
-
1
)
self
.
_idxs
.
append
(
v
)
def
get_all_names
(
self
):
return
self
.
_names
def
get_idx_for_each_entry
(
self
):
return
self
.
_idxs
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