Commit c8bcc541 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

add calculation of flops for the convolution

parent a175f14c
...@@ -629,6 +629,23 @@ auto get_flops_funcs() ...@@ -629,6 +629,23 @@ auto get_flops_funcs()
return 2.0 * m * n * k * batch; return 2.0 * m * n * k * batch;
}); });
op_funcs.emplace("convolution", [&](const std::vector<shape>& vec_ss) {
assert(vec_ss.size() >= 2);
auto alens = vec_ss.front().lens();
auto blens = vec_ss.at(1).lens();
auto olens = vec_ss.back().lens();
auto n = alens.front();
auto k = blens.front();
auto c = alens.at(1);
auto y = blens.at(2);
auto x = blens.back();
auto ho = olens.at(2);
auto wo = olens.back();
return 2.0 * n * k * ho * wo * c * y * x;
});
return op_funcs; return op_funcs;
} }
......
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