Skip to content

Commit

Permalink
coding style braces on every for body
Browse files Browse the repository at this point in the history
  • Loading branch information
netj committed Jan 23, 2017
1 parent 94b9d9b commit 1132d14
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/inference_result.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ InferenceResult::InferenceResult(const InferenceResult &other)

void InferenceResult::merge_gradients_from(const InferenceResult &other) {
assert(nweights == other.nweights);
for (size_t j = 0; j < nweights; ++j)
for (size_t j = 0; j < nweights; ++j) {
weight_grads[j] += other.weight_grads[j];
}
}

void InferenceResult::reset_gradients() {
Expand All @@ -78,8 +79,9 @@ void InferenceResult::average_weights(size_t count) {

void InferenceResult::copy_weights_to(InferenceResult &other) const {
assert(nweights == other.nweights);
for (size_t j = 0; j < nweights; ++j)
for (size_t j = 0; j < nweights; ++j) {
if (!weights_isfixed[j]) other.weight_values[j] = weight_values[j];
}
}

void InferenceResult::show_weights_snippet(std::ostream &output) const {
Expand Down

0 comments on commit 1132d14

Please sign in to comment.