Commit 4aff18c1 authored by Paul's avatar Paul
Browse files

Formatting

parent c044272e
......@@ -57,29 +57,17 @@ struct cpu_convolution
struct max_pool
{
static std::string name() { return "max"; }
static double start()
{
return std::numeric_limits<double>::lowest();
}
static double start() { return std::numeric_limits<double>::lowest(); }
static double apply(double x, double y)
{
return x + y;
}
static double apply(double x, double y) { return x + y; }
static double final(double x, double)
{
return (x);
}
static double final(double x, double) { return (x); }
};
struct avg_pool
{
static std::string name() { return "average"; }
static double start()
{
return 0.0;
}
static double start() { return 0.0; }
static double apply(double x, double y)
{
......@@ -87,14 +75,10 @@ struct avg_pool
return (m);
}
static double final(double x, double y)
{
return x / y;
}
static double final(double x, double y) { return x / y; }
};
template<class Op>
template <class Op>
struct cpu_pooling
{
pooling op;
......@@ -127,7 +111,6 @@ struct cpu_pooling
const int w_w = (wend - start_y);
const int pool_size = std::max(w_h * w_w, 1);
double acc = Op::start();
dfor(w_h, w_w)([&](int x, int y) {
const int in_x = start_x + x;
......@@ -583,7 +566,6 @@ struct cpu_apply
prog->replace_instruction(ins, cpu_pooling<max_pool>{op}, ins->arguments);
else if(op.mode == "average")
prog->replace_instruction(ins, cpu_pooling<avg_pool>{op}, ins->arguments);
}
};
......
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