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

Function sub_opr_config

dnn/src/cuda/convolution3d/forward/group_conv.cpp:8–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7namespace {
8std::pair<TensorLayoutArray, Convolution3DForwardImpl::Param> sub_opr_config(
9 const Convolution3DForwardImpl::AlgoBase::SizeArgs& args) {
10 TensorLayout src_pg = *args.src_layout;
11 TensorLayout filter_pg = *args.filter_layout;
12 TensorLayout dst_pg = *args.dst_layout;
13
14 auto nr_grp = args.filter_meta.group;
15 size_t c_pos;
16 if (args.filter_meta.format == param::Convolution3D::Format::NCDHW) {
17 c_pos = 1;
18 } else {
19 megdnn_assert(
20 args.filter_meta.format == param::Convolution3D::Format::NDHWC,
21 "invalid conv format");
22 c_pos = 4;
23 }
24 filter_pg.remove_axis_inplace(0);
25 src_pg.shape[c_pos] /= nr_grp;
26 dst_pg.shape[c_pos] /= nr_grp;
27
28 megdnn::param::Convolution3D param = args.opr->param();
29 param.sparse = megdnn::param::Convolution3D::Sparse::DENSE;
30 std::pair<TensorLayoutArray, Convolution3DForwardImpl::Param> ret;
31 ret.first = {src_pg, filter_pg, dst_pg};
32 ret.second = param;
33
34 return ret;
35}
36
37std::pair<TensorLayoutArray, std::unique_ptr<Convolution3DForward>> prepare_sub_opr(
38 const Convolution3DForwardImpl::AlgoBase::SizeArgs& args) {

Callers 2

prepare_sub_oprFunction · 0.70
get_subopr_listMethod · 0.70

Calls 2

remove_axis_inplaceMethod · 0.80
paramMethod · 0.45

Tested by

no test coverage detected