Skip to content

Commit

Permalink
Use simpler implementation for reference
Browse files Browse the repository at this point in the history
  • Loading branch information
greole committed Oct 19, 2023
1 parent 7b15bdb commit d152e73
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions reference/matrix/dense_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,10 @@ void compute_mean(std::shared_ptr<const ReferenceExecutor> exec,
}

for (size_type i = 0; i < x->get_size()[0]; ++i) {
const ValueType_nc alpha = static_cast<ValueType_nc>(i) / (i + 1);
const ValueType_nc beta = static_cast<ValueType_nc>(1) / (i + 1);
for (size_type j = 0; j < x->get_size()[1]; ++j) {
result->at(0, j) = alpha * result->at(0, j) + beta * x->at(i, j);
result->at(0, i) += x->at(i, j);
}
result->at(0, i) /= static_cast<ValueType_nc>(x->get_size()[1]);
}
}

Expand Down

0 comments on commit d152e73

Please sign in to comment.