Commit 0f2b0684 authored by Paul's avatar Paul
Browse files

Formatting

parent cff83eda
...@@ -314,7 +314,7 @@ struct reshape ...@@ -314,7 +314,7 @@ struct reshape
struct gemm struct gemm
{ {
float alpha = 1.0; float alpha = 1.0;
float beta = 0.0; float beta = 0.0;
std::string name() const { return "gemm"; } std::string name() const { return "gemm"; }
shape compute_shape(std::vector<shape> inputs) const shape compute_shape(std::vector<shape> inputs) const
{ {
......
...@@ -227,10 +227,10 @@ struct cpu_gemm ...@@ -227,10 +227,10 @@ struct cpu_gemm
std::string name() const { return "cpu::gemm"; } std::string name() const { return "cpu::gemm"; }
shape compute_shape(std::vector<shape> inputs) const { return op.compute_shape(inputs); } shape compute_shape(std::vector<shape> inputs) const { return op.compute_shape(inputs); }
template<class T> template <class T>
using matrix = blaze::CustomMatrix<T, blaze::unaligned, blaze::unpadded>; // NOLINT using matrix = blaze::CustomMatrix<T, blaze::unaligned, blaze::unpadded>; // NOLINT
template<class T> template <class T>
static auto make_mat(tensor_view<T> x) static auto make_mat(tensor_view<T> x)
{ {
const auto& s = x.get_shape(); const auto& s = x.get_shape();
...@@ -241,7 +241,7 @@ struct cpu_gemm ...@@ -241,7 +241,7 @@ struct cpu_gemm
return matrix<T>{x.data(), s.lens()[0], s.lens()[1]}; return matrix<T>{x.data(), s.lens()[0], s.lens()[1]};
} }
template<class T, class F> template <class T, class F>
static void visit_mat(tensor_view<T> x, F f) static void visit_mat(tensor_view<T> x, F f)
{ {
auto mat = make_mat(x); auto mat = make_mat(x);
...@@ -258,9 +258,9 @@ struct cpu_gemm ...@@ -258,9 +258,9 @@ struct cpu_gemm
visit_mat(amat, [&](const auto& a) { visit_mat(amat, [&](const auto& a) {
visit_mat(bmat, [&](const auto& b) { visit_mat(bmat, [&](const auto& b) {
auto c = make_mat(cmat); auto c = make_mat(cmat);
if (op.alpha == 1.0 and op.beta == 0.0) if(op.alpha == 1.0 and op.beta == 0.0)
c = a * b; c = a * b;
else else
c = (a * b) * op.alpha + op.beta * c; c = (a * b) * op.alpha + op.beta * c;
}); });
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment