"src/include/gridwise_direct_convolution_2.hip.hpp" did not exist on "1f3870ca19e6392c2453e63ed187f0cca6872295"
Commit 6177e85e authored by Khalique's avatar Khalique
Browse files

formatting

parent 2f65d247
...@@ -54,8 +54,8 @@ struct batch_norm_inference ...@@ -54,8 +54,8 @@ struct batch_norm_inference
struct lrn struct lrn
{ {
float alpha = 0.0001; float alpha = 0.0001;
float beta = 0.75; float beta = 0.75;
float bias = 1.0; float bias = 1.0;
int size; int size;
std::string name() const { return "lrn"; } std::string name() const { return "lrn"; }
......
...@@ -109,13 +109,13 @@ struct cpu_lrn ...@@ -109,13 +109,13 @@ struct cpu_lrn
int height = output_shape.lens()[2]; int height = output_shape.lens()[2];
int width = output_shape.lens()[3]; int width = output_shape.lens()[3];
auto alphaoverarea = op.alpha / op.size; auto alphaoverarea = op.alpha / op.size;
auto radius = (op.size - 1) / 2; auto radius = (op.size - 1) / 2;
dfor(n_batch, height, width)([&](int b, int h, int w){ dfor(n_batch, height, width)([&](int b, int h, int w) {
double scale = 0; double scale = 0;
dfor(channels)([&](int c) { dfor(channels)([&](int c) {
auto start = (c - radius) < 0 ? 0 : (c - radius); auto start = (c - radius) < 0 ? 0 : (c - radius);
auto end = (c + radius) > channels ? channels : (c + radius); auto end = (c + radius) > channels ? channels : (c + radius);
for(auto k = start; k < end; ++k) for(auto k = start; k < end; ++k)
{ {
...@@ -124,14 +124,13 @@ struct cpu_lrn ...@@ -124,14 +124,13 @@ struct cpu_lrn
scale *= alphaoverarea; scale *= alphaoverarea;
scale += op.bias; scale += op.bias;
scale = std::pow(scale, -op.beta); scale = std::pow(scale, -op.beta);
output(b, c, h, w) = input(b, c, h, w) * scale; output(b, c, h, w) = input(b, c, h, w) * scale;
}); });
}); });
}); });
return result; return result;
} }
}; };
struct cpu_convolution struct cpu_convolution
......
...@@ -22,7 +22,7 @@ using activation_descriptor = MIGRAPH_MANAGE_PTR(miopenActivationDescriptor_t, ...@@ -22,7 +22,7 @@ using activation_descriptor = MIGRAPH_MANAGE_PTR(miopenActivationDescriptor_t,
using fusion_plan_descriptor = MIGRAPH_MANAGE_PTR(miopenFusionPlanDescriptor_t, using fusion_plan_descriptor = MIGRAPH_MANAGE_PTR(miopenFusionPlanDescriptor_t,
miopenDestroyFusionPlan); miopenDestroyFusionPlan);
using fused_operator_args = MIGRAPH_MANAGE_PTR(miopenOperatorArgs_t, miopenDestroyOperatorArgs); using fused_operator_args = MIGRAPH_MANAGE_PTR(miopenOperatorArgs_t, miopenDestroyOperatorArgs);
using lrn_descriptor = MIGRAPH_MANAGE_PTR(miopenLRNDescriptor_t, miopenDestroyLRNDescriptor); using lrn_descriptor = MIGRAPH_MANAGE_PTR(miopenLRNDescriptor_t, miopenDestroyLRNDescriptor);
template <class Result, class F, class... Ts> template <class Result, class F, class... Ts>
Result make_obj(F f, Ts... xs) Result make_obj(F f, Ts... xs)
......
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