MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / get_dest_shape

Function get_dest_shape

dnn/src/cuda/convpooling/opr_impl.cpp:10–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8using namespace conv_pool;
9
10void get_dest_shape(
11 size_t ih, size_t iw, size_t fh, size_t fw, size_t sh, size_t sw, size_t ph,
12 size_t pw, size_t& oh, size_t& ow, bool is_floor = true) {
13 megdnn_assert(
14 ih + 2 * ph >= fh,
15 "input height=%zu, padding height=%zu, "
16 "filter height=%zu",
17 ih, ph, fh);
18 megdnn_assert(
19 iw + 2 * pw >= fw,
20 "input width=%zu, padding width=%zu, "
21 "filter width=%zu",
22 iw, pw, fw);
23 megdnn_assert(sh && sw, "invalid stride setting: (%zu, %zu)", sh, sw);
24 if (is_floor) {
25 oh = (ih + 2 * ph - fh) / sh + 1;
26 ow = (iw + 2 * pw - fw) / sw + 1;
27 } else {
28 oh = (ih + 2 * ph - fh + sh - 1) / sh + 1;
29 ow = (iw + 2 * pw - fw + sw - 1) / sw + 1;
30 }
31}
32
33ConvPoolingForwardImpl::ConvPoolingForwardImpl(Handle* handle)
34 : ConvPoolingForward(handle) {

Callers 1

deduce_layoutMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected