Minor Net::Init refactoring #495
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is purely for refactoring; it's not intended to change any behavior whatsoever. It makes the
Net::Initmethod a bit more readable (imo) by (1) changing the single-character loop index var names (which I use constantly, no offense intended) to more meaningful ones likelayer_idorbottom_id, and (2) factoring out some ofInitinto separate methodsAppendBottomandAppendTop.AppendBottomis called once for each bottom blob,AppendTopis called once for each top blob or input blob (merging the common setup between inputs and normal top blobs).I will follow up with other PRs built on top this one, but I'm PRing this first to make it easier to see what has actually changed with those further PRs in terms of behavior, vs. just changes due to refactoring. Feel free to ignore this PR until those followups appear.