/third_party/mindspore/mindspore/nn/layer/ |
D | pooling.py | 29 def __init__(self, kernel_size, stride, pad_mode, data_format="NCHW"): argument 54 self.kernel_size = _check_int_or_tuple('kernel_size', kernel_size) 133 def __init__(self, kernel_size=1, stride=1, pad_mode="valid", data_format="NCHW"): argument 135 super(MaxPool2d, self).__init__(kernel_size, stride, pad_mode, data_format) 136 self.max_pool = P.MaxPool(kernel_size=self.kernel_size, 202 def __init__(self, kernel_size=1, stride=1, pad_mode="valid"): argument 204 super(MaxPool1d, self).__init__(kernel_size, stride, pad_mode) 205 validator.check_value_type('kernel_size', kernel_size, [int], self.cls_name) 208 validator.check_int(kernel_size, 1, Rel.GE, "kernel_size", self.cls_name) 210 self.kernel_size = (1, kernel_size) [all …]
|
D | conv.py | 39 kernel_size, argument 54 self.kernel_size = kernel_size 82 for kernel_size_elem in kernel_size: 95 shape = [in_channels, out_channels // group, *kernel_size] 97 … shape = [out_channels, *kernel_size, in_channels // group] if self.format == "NHWC" else \ 98 [out_channels, in_channels // group, *kernel_size] 226 kernel_size, argument 237 kernel_size = twice(kernel_size) 244 kernel_size, 255 kernel_size=self.kernel_size, [all …]
|
/third_party/boost/boost/gil/image_processing/ |
D | filter.hpp | 31 std::size_t kernel_size, in box_filter() argument 46 if (normalize) { kernel_values.resize(kernel_size, 1.0f / float(kernel_size)); } in box_filter() 47 else { kernel_values.resize(kernel_size, 1.0f); } in box_filter() 49 if (anchor == -1) anchor = static_cast<int>(kernel_size / 2); in box_filter() 50 kernel_1d<float> kernel(kernel_values.begin(), kernel_size, anchor); in box_filter() 62 std::size_t kernel_size, in blur() argument 67 box_filter(src_view, dst_view, kernel_size, anchor, true, option); in blur() 74 void filter_median_impl(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size) in filter_median_impl() argument 76 std::size_t half_kernel_size = kernel_size / 2; in filter_median_impl() 82 values.reserve(kernel_size * kernel_size); in filter_median_impl() [all …]
|
/third_party/mindspore/mindspore/lite/examples/export_models/models/ |
D | NetworkInNetwork.py | 31 … nn.Conv2d(in_channels=num_channel, out_channels=192, kernel_size=5, stride=1, has_bias=False), 33 nn.Conv2d(in_channels=192, out_channels=160, kernel_size=1, stride=1, has_bias=True), 35 nn.Conv2d(in_channels=160, out_channels=96, kernel_size=1, stride=1, has_bias=True), 37 nn.MaxPool2d(kernel_size=3, stride=2, pad_mode='same'), 42 nn.Conv2d(in_channels=96, out_channels=192, kernel_size=5, stride=1, has_bias=False), 44 nn.Conv2d(in_channels=192, out_channels=192, kernel_size=1, stride=1, has_bias=True), 46 nn.Conv2d(in_channels=192, out_channels=192, kernel_size=1, stride=1, has_bias=True), 48 nn.MaxPool2d(kernel_size=3, stride=2, pad_mode='same'), 53 nn.Conv2d(in_channels=192, out_channels=192, kernel_size=3, stride=1, has_bias=False), 55 nn.Conv2d(in_channels=192, out_channels=192, kernel_size=1, stride=1, has_bias=True), [all …]
|
D | effnet.py | 73 …self.conv_reduce = nn.Conv2d(in_channels=channel, out_channels=reduced_chs, kernel_size=1, has_bia… 76 …self.conv_expand = nn.Conv2d(in_channels=reduced_chs, out_channels=channel, kernel_size=1, has_bia… 98 …self.conv_dw = nn.Conv2d(in_channels=in_chs, out_channels=in_chs, kernel_size=dw_kernel_size, stri… 109 …self.conv_pw = nn.Conv2d(in_channels=in_chs, out_channels=out_chs, kernel_size=1, stride=stride, h… 133 …nn.Conv2d(in_channels=inp, out_channels=oup, kernel_size=3, stride=stride, padding=1, weight_init=… 142 …nn.Conv2d(in_channels=inp, out_channels=oup, kernel_size=1, stride=1, padding=0, weight_init=weigh… 150 def __init__(self, in_chs, out_chs, kernel_size, stride, padding, expansion, se_ratio): argument 160 …self.conv_pw = nn.Conv2d(in_channels=in_chs, out_channels=mid_chs, kernel_size=1, stride=1, has_bi… 166 …f.conv_dw = nn.Conv2d(in_channels=mid_chs, out_channels=mid_chs, kernel_size=kernel_size, stride=s… 169 …f.conv_dw = nn.Conv2d(in_channels=mid_chs, out_channels=mid_chs, kernel_size=kernel_size, stride=s… [all …]
|
/third_party/mindspore/tests/ut/python/parallel/ |
D | test_conv2d.py | 26 … def __init__(self, conv2d_weight, out_channel, kernel_size, pad_mode, stride, dilation=1, group=1, argument 29 self.conv2d = P.Conv2D(out_channel=out_channel, kernel_size=kernel_size, 63 …net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, strategy1=strategy1, strat… 71 net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=(2, 2, 1, 1), 81 net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, dilation=2, 90 net = Net(_w4, out_channel=8, kernel_size=2, pad_mode="same", stride=1, group=2, 99 …net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, strategy1=strategy1, strat… 107 net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, dilation=2, 117 net = Net(_w4, out_channel=8, kernel_size=2, pad_mode="same", stride=1, group=2, 127 …net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=2, strategy1=strategy1, strat… [all …]
|
D | test_maxpool_avgpool.py | 26 …def __init__(self, conv2d_weight, out_channel, kernel_size, pad_mode, stride, pool_kernel_size, po… argument 29 self.conv2d = P.Conv2D(out_channel=out_channel, kernel_size=kernel_size, 32 … self.max_pool = P.MaxPool(kernel_size=pool_kernel_size, strides=pool_strides).shard(strategy2) 41 …def __init__(self, conv2d_weight, out_channel, kernel_size, pad_mode, stride, pool_kernel_size, po… argument 44 self.conv2d = P.Conv2D(out_channel=out_channel, kernel_size=kernel_size, 47 … self.avg_pool = P.AvgPool(kernel_size=pool_kernel_size, strides=pool_strides).shard(strategy2) 74 …net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, pool_kernel_size=2, pool_s… 83 …net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, pool_kernel_size=2, pool_s… 92 …net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, pool_kernel_size=2, pool_s… 99 …net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, pool_kernel_size=2, pool_s… [all …]
|
D | test_resizebilinear.py | 28 def __init__(self, conv2d_weight, out_channel, kernel_size, pad_mode, stride, argument 31 self.conv2d = P.Conv2D(out_channel=out_channel, kernel_size=kernel_size, 46 def __init__(self, conv2d_weight, out_channel, kernel_size, pad_mode, stride, argument 49 self.conv2d = P.Conv2D(out_channel=out_channel, kernel_size=kernel_size, 63 def __init__(self, conv2d_weight, out_channel, kernel_size, pad_mode, stride, argument 66 self.conv2d = P.Conv2D(out_channel=out_channel, kernel_size=kernel_size, 94 net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, 103 net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, 112 net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, 119 net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1) [all …]
|
D | test_conv2d_transpose.py | 26 def __init__(self, conv2d_weight, out_channel, kernel_size, pad_mode, stride, argument 29 self.conv2d_transpose = P.Conv2DTranspose(out_channel=out_channel, kernel_size=kernel_size, 41 def __init__(self, conv2d_weight, out_channel, kernel_size, pad_mode, stride, argument 44 self.conv2d_transpose = P.Conv2DTranspose(out_channel=out_channel, kernel_size=kernel_size, 76 …net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, strategy1=strategy1, strat… 84 …net = Net(_w1, out_channel=8, kernel_size=2, pad_mode="same", stride=1, strategy1=strategy1, strat… 92 net = Net2(_w2, out_channel=8, kernel_size=(4, 4), pad_mode="same", stride=2, 101 net = Net2(_w2, out_channel=8, kernel_size=(4, 4), pad_mode="same", stride=2, 110 net = Net2(_w1, out_channel=8, kernel_size=(2, 2), pad_mode="same", stride=2, 119 net = Net2(_w1, out_channel=8, kernel_size=(2, 2), pad_mode="pad", stride=2, [all …]
|
/third_party/mindspore/tests/st/ops/cpu/ |
D | test_maxpool_op.py | 31 self.maxpool_fun = nn.MaxPool2d(kernel_size=2, stride=2, pad_mode="VALID") 40 self.maxpool_fun2 = nn.MaxPool2d(kernel_size=3, stride=2, pad_mode="SAME") 101 kernel_size = (2, 2, 3) 106 output_ms = P.MaxPool3D(kernel_size=kernel_size, strides=strides, pad_mode=pad_mode)(x_ms) 128 kernel_size = 2 133 output_ms = P.MaxPool3D(kernel_size=kernel_size, strides=strides, pad_mode=pad_mode)(x_ms) 155 kernel_size = 2 160 output_ms = P.MaxPool3D(kernel_size=kernel_size, strides=strides, pad_mode=pad_mode)(x_ms) 176 kernel_size = (2, 2, 3) 181 output_ms = P.MaxPool3D(kernel_size=kernel_size, strides=strides, pad_mode=pad_mode)(x_ms) [all …]
|
/third_party/mindspore/tests/st/ops/gpu/ |
D | test_maxpool_gpu_op.py | 29 self.maxpool_fun = nn.MaxPool2d(kernel_size=2, stride=2, pad_mode="VALID") 38 self.maxpool_fun = nn.MaxPool2d(kernel_size=3, stride=2, pad_mode="SAME") 90 kernel_size = (2, 2, 3) 95 output_ms = P.MaxPool3D(kernel_size=kernel_size, strides=strides, pad_mode=pad_mode)(x_ms) 117 kernel_size = 2 122 output_ms = P.MaxPool3D(kernel_size=kernel_size, strides=strides, pad_mode=pad_mode)(x_ms) 144 kernel_size = 2 149 output_ms = P.MaxPool3D(kernel_size=kernel_size, strides=strides, pad_mode=pad_mode)(x_ms) 165 kernel_size = (2, 2, 3) 170 output_ms = P.MaxPool3D(kernel_size=kernel_size, strides=strides, pad_mode=pad_mode)(x_ms) [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/ir_fusion/ |
D | avgpool_3d_fusion.cc | 58 auto kernel_size = AnfAlgo::GetNodeAttr<std::vector<int64_t>>(node, "kernel_size"); in GetKernelSize() local 59 if (kernel_size.size() == 1) { in GetKernelSize() 60 *kd = kernel_size[kDim0]; in GetKernelSize() 61 *kh = kernel_size[kDim0]; in GetKernelSize() 62 *kw = kernel_size[kDim0]; in GetKernelSize() 63 } else if (kernel_size.size() == kDHWDimNum) { in GetKernelSize() 64 *kd = kernel_size[kDim0]; in GetKernelSize() 65 *kh = kernel_size[kDim1]; in GetKernelSize() 66 *kw = kernel_size[kDim2]; in GetKernelSize() 67 } else if (kernel_size.size() == kNCDHWDimNum) { in GetKernelSize() [all …]
|
D | avgpool_3d_grad_fusion.cc | 40 void GetAttrs(const AnfNodePtr &node, std::vector<int64_t> *kernel_size, std::vector<int64_t> *stri… in GetAttrs() argument 48 *kernel_size = AnfAlgo::GetNodeAttr<std::vector<int64_t>>(node, "kernel_size"); in GetAttrs() 122 … const std::vector<int64_t> &ori_input_shape, const std::vector<int64_t> &kernel_size, in ConstructMultiplier() argument 151 … valid_d = start_d + kernel_size[kDim0] <= len_d ? kernel_size[kDim0] : len_d - start_d; in ConstructMultiplier() 152 … valid_h = start_h + kernel_size[kDim1] <= len_h ? kernel_size[kDim1] : len_h - start_h; in ConstructMultiplier() 153 … valid_w = start_w + kernel_size[kDim2] <= len_w ? kernel_size[kDim2] : len_w - start_w; in ConstructMultiplier() 155 … valid_d = std::min(start_d + kernel_size[kDim0], pad_list[kDim0] + ori_input_shape[kDim2]) - in ConstructMultiplier() 157 … valid_h = std::min(start_h + kernel_size[kDim1], pad_list[kDim2] + ori_input_shape[kDim3]) - in ConstructMultiplier() 159 … valid_w = std::min(start_w + kernel_size[kDim2], pad_list[kDim4] + ori_input_shape[kDim4]) - in ConstructMultiplier() 203 std::vector<int64_t> kernel_size; in Process() local [all …]
|
/third_party/mindspore/tests/ut/python/pynative_mode/nn/ |
D | test_pooling.py | 27 kernel_size = 3 29 avg_pool = nn.AvgPool2d(kernel_size, stride) 30 assert avg_pool.kernel_size == 3 40 kernel_size = 5 43 nn.AvgPool2d(kernel_size, stride) 48 kernel_size = 3 51 max_pool = nn.MaxPool2d(kernel_size, stride, pad_mode='SAME') 52 assert max_pool.kernel_size == 3
|
/third_party/mindspore/tests/st/networks/models/deeplabv3/src/backbone/ |
D | resnet_deeplab.py | 35 kernel_size=ksize, 57 kernel_size=ksize, 84 kernel_size=ksize, 111 kernel_size=ksize, 176 self.pool = nn.MaxPool2d(kernel_size=1, 212 kernel_size, argument 222 self.kernel_size = kernel_size 231 if (not isinstance(kernel_size, tuple)) or len(kernel_size) != 2 or \ 232 (not isinstance(kernel_size[0], int)) or (not isinstance(kernel_size[1], int)) or \ 233 kernel_size[0] < 1 or kernel_size[1] < 1: [all …]
|
/third_party/mindspore/mindspore/nn/probability/bnn_layers/ |
D | conv_variational.py | 33 kernel_size, argument 44 kernel_size = twice(kernel_size) 50 kernel_size, 67 self.kernel_size = kernel_size 75 self.shape = [self.out_channels, self.in_channels // self.group, *self.kernel_size] 91 kernel_size=self.kernel_size, 112 ….format(self.in_channels, self.out_channels, self.kernel_size, self.stride, self.pad_mode, self.pa… 236 kernel_size, argument 250 kernel_size,
|
/third_party/mindspore/mindspore/lite/src/ops/populate/ |
D | pooling_populate.cc | 97 auto kernel_size = value->kernel_size(); in PopulateAvgPoolParameter() local 98 if (kernel_size == nullptr || kernel_size->size() < kMinShapeSizeTwo) { in PopulateAvgPoolParameter() 103 param->window_w_ = static_cast<int>(*(kernel_size->begin() + 1)); in PopulateAvgPoolParameter() 104 param->window_h_ = static_cast<int>(*(kernel_size->begin())); in PopulateAvgPoolParameter() 133 auto kernel_size = value->kernel_size(); in PopulateMaxPoolParameter() local 135 if (kernel_size == nullptr || strides == nullptr || kernel_size->size() < kMinShapeSizeTwo || in PopulateMaxPoolParameter() 141 param->window_w_ = static_cast<int>(*(kernel_size->begin() + 1)); in PopulateMaxPoolParameter() 142 param->window_h_ = static_cast<int>(*(kernel_size->begin())); in PopulateMaxPoolParameter()
|
D | deconv2d_populate.cc | 41 auto kernel_size = value->kernel_size(); in PopulateDeconvParameter() local 48 if (kernel_size != nullptr) { in PopulateDeconvParameter() 49 if (kernel_size->size() < kMinShapeSizeTwo) { in PopulateDeconvParameter() 54 param->kernel_h_ = static_cast<int>(*(kernel_size->begin())); in PopulateDeconvParameter() 55 param->kernel_w_ = static_cast<int>(*(kernel_size->begin() + 1)); in PopulateDeconvParameter() 78 param->kernel_h_ = static_cast<int>(*(kernel_size->begin())); in PopulateDeconvParameter() 79 param->kernel_w_ = static_cast<int>(*(kernel_size->begin() + 1)); in PopulateDeconvParameter()
|
/third_party/mindspore/tests/st/model_zoo_tests/yolov3_darknet53/src/ |
D | darknet.py | 22 kernel_size, argument 32 kernel_size=kernel_size, 63 self.conv1 = conv_block(in_channels, out_chls, kernel_size=1, stride=1) 64 self.conv2 = conv_block(out_chls, out_channels, kernel_size=3, stride=1) 112 kernel_size=3, 116 kernel_size=3, 120 kernel_size=3, 124 kernel_size=3, 128 kernel_size=3, 132 kernel_size=3,
|
/third_party/ffmpeg/libavfilter/dnn/ |
D | dnn_backend_native_layer_conv2d.c | 49 int kernel_size; in ff_dnn_load_layer_conv2d() local 60 conv_params->kernel_size = (int32_t)avio_rl32(model_file_context); in ff_dnn_load_layer_conv2d() 64 kernel_size = conv_params->input_num * conv_params->output_num * in ff_dnn_load_layer_conv2d() 65 conv_params->kernel_size * conv_params->kernel_size; in ff_dnn_load_layer_conv2d() 66 dnn_size += kernel_size * 4; in ff_dnn_load_layer_conv2d() 71 conv_params->output_num <= 0 || conv_params->kernel_size <= 0){ in ff_dnn_load_layer_conv2d() 76 conv_params->kernel = av_malloc_array(kernel_size, sizeof(*conv_params->kernel)); in ff_dnn_load_layer_conv2d() 81 for (int i = 0; i < kernel_size; ++i) { in ff_dnn_load_layer_conv2d() 124 int radius = conv_params->kernel_size >> 1; in dnn_execute_layer_conv2d_thread() 126 int filter_linesize = conv_params->kernel_size * conv_params->input_num; in dnn_execute_layer_conv2d_thread() [all …]
|
D | dnn_backend_native_layer_avgpool.c | 39 avgpool_params->kernel_size = (int32_t)avio_rl32(model_file_context); in ff_dnn_load_layer_avg_pool() 42 if (dnn_size > file_size || avgpool_params->kernel_size <= 0 || avgpool_params->strides <=0){ in ff_dnn_load_layer_avg_pool() 87 height_radius = avgpool_params->kernel_size - ((height - 1) % kernel_strides + 1); in ff_dnn_execute_layer_avg_pool() 88 width_radius = avgpool_params->kernel_size - ((width - 1) % kernel_strides + 1); in ff_dnn_execute_layer_avg_pool() 95 height_end = height - avgpool_params->kernel_size + 1; in ff_dnn_execute_layer_avg_pool() 96 width_end = width - avgpool_params->kernel_size + 1; in ff_dnn_execute_layer_avg_pool() 99 output_height = ceil((height - avgpool_params->kernel_size + 1) / (kernel_strides * 1.0)); in ff_dnn_execute_layer_avg_pool() 100 output_width = ceil((width - avgpool_params->kernel_size + 1) / (kernel_strides * 1.0)); in ff_dnn_execute_layer_avg_pool() 126 for (int kernel_y = 0; kernel_y < avgpool_params->kernel_size; ++kernel_y) { in ff_dnn_execute_layer_avg_pool() 127 for (int kernel_x = 0; kernel_x < avgpool_params->kernel_size; ++kernel_x) { in ff_dnn_execute_layer_avg_pool()
|
/third_party/mindspore/tests/ut/python/pynative_mode/ge/ops/ |
D | test_pooling.py | 28 kernel_size = 3 30 avg_pool = nn.AvgPool2d(kernel_size, stride) 31 assert avg_pool.kernel_size == 3 43 kernel_size = 3 46 max_pool = nn.MaxPool2d(kernel_size, stride) 47 assert max_pool.kernel_size == 3
|
D | test_conv.py | 28 def get_me_conv_output(input_data, weight, in_channel, out_channel, kernel_size, argument 35 def __init__(self, weight, in_channel, out_channel, kernel_size, argument 40 kernel_size=kernel_size, 50 net = Net(weight, in_channel, out_channel, kernel_size, stride, padding, has_bias, bias) 61 out_channel=6, kernel_size=7, stride=7, padding=0) 72 out_channel=6, kernel_size=7, stride=7, padding=0)
|
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/ |
D | resize_cubic_op.cc | 60 int kernel_size; in calc_coeff() local 77 kernel_size = static_cast<int>(ceil(threshold)) * 2 + 1; in calc_coeff() 78 if (out_size > INT_MAX / (kernel_size * static_cast<int>(sizeof(double)))) { in calc_coeff() 84 std::vector<double> coeffs(out_size * kernel_size, 0.0); in calc_coeff() 102 double *coeff = &coeffs[xx * kernel_size]; in calc_coeff() 114 for (; x < kernel_size; x++) { in calc_coeff() 123 return kernel_size; in calc_coeff() 126 void normalize_coeff(int out_size, int kernel_size, const std::vector<double> &prekk, std::vector<i… in normalize_coeff() argument 127 for (int x = 0; x < out_size * kernel_size; x++) { in normalize_coeff() 136 Status ImagingHorizontalInterp(LiteMat &output, LiteMat input, int offset, int kernel_size, in ImagingHorizontalInterp() argument [all …]
|
/third_party/mindspore/mindspore/lite/examples/transfer_learning/model/ |
D | effnet.py | 68 … in_channels=channel, out_channels=reduced_chs, kernel_size=1, has_bias=True, weight_init=weight) 71 in_channels=reduced_chs, out_channels=channel, kernel_size=1, has_bias=True) 96 … self.conv_dw = nn.Conv2d(in_channels=in_chs, out_channels=in_chs, kernel_size=dw_kernel_size, 107 in_channels=in_chs, out_channels=out_chs, kernel_size=1, stride=stride, has_bias=False) 129 nn.Conv2d(in_channels=inp, out_channels=oup, kernel_size=3, stride=stride, 138 nn.Conv2d(in_channels=inp, out_channels=oup, kernel_size=1, 148 def __init__(self, in_chs, out_chs, kernel_size, stride, padding, expansion, se_ratio): argument 157 in_channels=in_chs, out_channels=mid_chs, kernel_size=1, stride=1, has_bias=False) 161 … self.conv_dw = nn.Conv2d(in_channels=mid_chs, out_channels=mid_chs, kernel_size=kernel_size, 164 … self.conv_dw = nn.Conv2d(in_channels=mid_chs, out_channels=mid_chs, kernel_size=kernel_size, [all …]
|