Skip to content

Conversation

@longjon
Copy link
Contributor

@longjon longjon commented Mar 9, 2015

Currently, Net keeps track of each layer's input and output blobs. However, since layers can be in-place, this information isn't sufficient to easily obtain the dependencies present in the computation graph.

This PR adds layer_parents and layer_children to Net. The parents of a layer (index) are the layers (indices) whose forwards must come before that layer's forward. The children of a layer are the layers whose backwards must come before that layer's backward.

Note that the hard distinction that we've maintained so far between backward and forward means that there are additional, untracked dependencies in the computation graph; namely, a layer's forward must come before its backward. I don't anticipate any serious consequences of this.

This graph will be used in a future PR, to allow correct multithreaded computation.

Instead of just keeping track of input and output blobs, also keep track
of layer dependencies. (Also adjust AppendBottom's argument types to
avoid passing an input as a pointer.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

available_blobs should be last arg

@jeffdonahue
Copy link
Contributor

LGTM other than my style comment. Ideally it'd have a test or two but I guess it can't break anything given that it's just adding some new member vars...

@futurely
Copy link

There is a very simple solution to manage the forward and backward computation of the predecessors and successors in a general flow graph.

@shelhamer
Copy link
Member

Closing as #2219 was closed.

@shelhamer shelhamer closed this Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants