/third_party/mindspore/mindspore/core/ops/ |
D | avg_pool_3d.cc | 35 int64_t *pad_mode, std::vector<int64_t> *pad_list, bool *ceil_mode) { in GetAttrs() argument 51 *pad_list = GetValue<std::vector<int64_t>>(primitive->GetAttr(kPadList)); in GetAttrs() 60 const std::vector<int64_t> &pad_list, bool ceil_mode) { in GetOutputShape() argument 69 …static_cast<int64_t>(std::floor((in_d + pad_list[0] + pad_list[1] - kernel_d + stride_d - 1) / str… in GetOutputShape() 71 …static_cast<int64_t>(std::floor((in_h + pad_list[2] + pad_list[3] - kernel_h + stride_h - 1) / str… in GetOutputShape() 73 …static_cast<int64_t>(std::floor((in_w + pad_list[4] + pad_list[5] - kernel_w + stride_w - 1) / str… in GetOutputShape() 74 if ((out_d - 1) * stride_d >= in_d + pad_list[0]) { in GetOutputShape() 77 if ((out_h - 1) * stride_h >= in_h + pad_list[2]) { in GetOutputShape() 80 if ((out_w - 1) * stride_w >= in_w + pad_list[4]) { in GetOutputShape() 84 …out_d = static_cast<int64_t>(std::floor((in_d + pad_list[0] + pad_list[1] - kernel_d) / stride_d +… in GetOutputShape() [all …]
|
D | conv2d.cc | 72 void Conv2DPadFunction(std::vector<int64_t> *output_hw, std::vector<int64_t> *pad_list, const int64… in Conv2DPadFunction() argument 96 (void)pad_list->insert(pad_list->begin(), pad_size, 0); in Conv2DPadFunction() 100 pad_list->push_back(Shape::SHP_ANY); in Conv2DPadFunction() 101 pad_list->push_back(Shape::SHP_ANY); in Conv2DPadFunction() 106 pad_list->push_back(static_cast<int64_t>(std::floor(pad_needed_h / 2))); in Conv2DPadFunction() 107 pad_list->push_back(pad_needed_h - pad_list->at(0)); in Conv2DPadFunction() 112 pad_list->push_back(Shape::SHP_ANY); in Conv2DPadFunction() 113 pad_list->push_back(Shape::SHP_ANY); in Conv2DPadFunction() 118 pad_list->push_back(static_cast<int64_t>(std::floor(pad_needed_w / 2))); in Conv2DPadFunction() 119 pad_list->push_back(pad_needed_w - pad_list->at(kInputIndex2)); in Conv2DPadFunction() [all …]
|
D | adder.cc | 23 … const PadMode &pad_mode, const std::vector<int64_t> &stride, const std::vector<int64_t> &pad_list, in Init() argument 30 set_pad_list(pad_list); in Init() 76 …der::set_pad_list(const std::vector<int64_t> &pad_list) { (void)this->AddAttr(kPadList, MakeValue(… in set_pad_list() argument
|
D | conv2d_transpose.cc | 31 const Format &format, const std::vector<int64_t> &pad_list) { in Init() argument 42 set_pad_list(pad_list); in Init() 112 void Conv2DTranspose::set_pad_list(const std::vector<int64_t> &pad_list) { in set_pad_list() argument 114 …(void)CheckAndConvertUtils::CheckInteger(kPadList, SizeToLong(pad_list.size()), kEqual, pad_size, … in set_pad_list() 115 (void)this->AddAttr(kPadList, MakeValue(pad_list)); in set_pad_list()
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/ir_fusion/ |
D | avgpool_3d_grad_fusion.cc | 41 … std::vector<int64_t> *pad_list, std::vector<int64_t> *origin_input_shape, bool *ceil_mode, in GetAttrs() argument 58 *pad_list = AnfAlgo::GetNodeAttr<std::vector<int64_t>>(node, "pad_list"); in GetAttrs() 82 const std::vector<int64_t> &pad_list) { in IsVectorImpl() argument 90 bool flag1 = kd >= fd + pad_list[kDim0] + pad_list[kDim1]; in IsVectorImpl() 91 bool flag2 = kh >= fh + pad_list[kDim2] + pad_list[kDim3]; in IsVectorImpl() 92 bool flag3 = kw >= fw + pad_list[kDim4] + pad_list[kDim5]; in IsVectorImpl() 99 bool IsZeroPads(const std::vector<int64_t> &pad_list) { in IsZeroPads() argument 100 return std::all_of(pad_list.begin(), pad_list.end(), [](int64_t item) { return item == 0; }); in IsZeroPads() 103 AnfNodePtr ConstructFilter(const FuncGraphPtr &func_graph, const std::vector<int64_t> &pad_list, in… in ConstructFilter() argument 113 } else if (IsZeroPads(pad_list) && !ceil_mode) { in ConstructFilter() [all …]
|
D | avgpool_3d_fusion.cc | 108 void GetAttrs(const AnfNodePtr &node, std::vector<int64_t> *pad_list, bool *count_include_pad, bool… in GetAttrs() argument 114 *pad_list = AnfAlgo::GetNodeAttr<std::vector<int64_t>>(node, "pad_list"); in GetAttrs() 126 …sVectorImpl(int64_t fh, int64_t fw, int64_t kh, int64_t kw, const std::vector<int64_t> &pad_list) { in IsVectorImpl() argument 127 if (std::any_of(pad_list.begin(), pad_list.end(), [](int64_t item) { return item != 0; })) { in IsVectorImpl() 136 bool IsZeroPads(const std::vector<int64_t> &pad_list) { in IsZeroPads() argument 137 return std::all_of(pad_list.begin(), pad_list.end(), [](int64_t item) { return item == 0; }); in IsZeroPads() 140 AnfNodePtr ConstructFilter(const FuncGraphPtr &func_graph, const std::vector<int64_t> &pad_list, in… in ConstructFilter() argument 150 } else if (!IsZeroPads(pad_list) || ceil_mode) { in ConstructFilter() 160 … int64_t sd, int64_t sh, int64_t sw, const std::vector<int64_t> &pad_list, in ConstructMultiplier() argument 169 auto pad_d = pad_list[kDim0] + pad_list[kDim1]; in ConstructMultiplier() [all …]
|
/third_party/mindspore/mindspore/lite/src/ops/populate/ |
D | adder_populate.cc | 42 auto pad_list = value->pad_list(); in PopulateAdderParameter() local 44 if (kernel_size == nullptr || stride == nullptr || pad_list == nullptr || dilation == nullptr) { in PopulateAdderParameter() 50 pad_list->size() < kMinShapeSizeFour || dilation->size() < kMinShapeSizeTwo) { in PopulateAdderParameter() 60 param->pad_u_ = static_cast<int>(*(pad_list->begin())); in PopulateAdderParameter() 61 param->pad_d_ = static_cast<int>(*(pad_list->begin() + 1)); in PopulateAdderParameter() 62 param->pad_l_ = static_cast<int>(*(pad_list->begin() + kOffsetTwo)); in PopulateAdderParameter() 63 param->pad_r_ = static_cast<int>(*(pad_list->begin() + kOffsetThree)); in PopulateAdderParameter()
|
D | conv2d_populate.cc | 42 auto pad_list = value->pad_list(); in PopulateConvParameter() local 80 if (pad_list == nullptr || pad_list->size() < kMinShapeSizeFour) { in PopulateConvParameter() 86 param->pad_u_ = static_cast<int>(*(pad_list->begin())); in PopulateConvParameter() 87 param->pad_d_ = static_cast<int>(*(pad_list->begin() + 1)); in PopulateConvParameter() 88 param->pad_l_ = static_cast<int>(*(pad_list->begin() + kOffsetTwo)); in PopulateConvParameter() 89 param->pad_r_ = static_cast<int>(*(pad_list->begin() + kOffsetThree)); in PopulateConvParameter()
|
D | deconv2d_populate.cc | 43 auto pad_list = value->pad_list(); in PopulateDeconvParameter() local 93 if (pad_list == nullptr || pad_list->size() < kMinShapeSizeFour) { in PopulateDeconvParameter() 99 param->pad_u_ = static_cast<int>(*(pad_list->begin())); in PopulateDeconvParameter() 100 param->pad_d_ = static_cast<int>(*(pad_list->begin() + 1)); in PopulateDeconvParameter() 101 param->pad_l_ = static_cast<int>(*(pad_list->begin() + kOffsetTwo)); in PopulateDeconvParameter() 102 param->pad_r_ = static_cast<int>(*(pad_list->begin() + kOffsetThree)); in PopulateDeconvParameter()
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/nn/ |
D | conv3d_transpose_gpu_kernel.h | 142 std::vector<int> pad_list; in Init() local 144 (void)std::transform(pad_list_me.begin(), pad_list_me.end(), std::back_inserter(pad_list), in Init() 151 (void)CheckSize(pad_list.size(), 6, "pad_list"); in Init() 153 UpdatePaddingAndDilation(input_shape, filter_shape, pad_list.data(), stride_pad_list.data()); in Init() 155 pad_depth_ = pad_list[0]; in Init() 156 pad_height_ = pad_list[2]; in Init() 157 pad_width_ = pad_list[4]; in Init() 158 …use_pad_ = !((pad_depth_ == pad_list[1]) && (pad_height_ == pad_list[3]) && (pad_width_ == pad_lis… in Init() 165 UsePadProcess(pad_list, strideA, dilaA); in Init() 373 std::vector<int> pad_list; in SetPad() local [all …]
|
D | conv3d_gpu_kernel.h | 111 std::vector<int> pad_list; in Init() local 113 (void)std::transform(pad_list_me.begin(), pad_list_me.end(), std::back_inserter(pad_list), in Init() 115 if (pad_list.size() != 6) { in Init() 116 …TION) << "For 'Conv3dGpuBkwKernel', the length of pad_list must be 6, but got " << pad_list.size(); in Init() 118 pad_depth_ = pad_list[0]; in Init() 119 pad_height_ = pad_list[2]; in Init() 120 pad_width_ = pad_list[4]; in Init() 121 …use_pad_ = (pad_depth_ != pad_list[1]) || (pad_height_ != pad_list[3]) || (pad_width_ != pad_list[… in Init() 131 pad_depth_ = pad_list[0] + pad_list[1]; in Init() 132 pad_height_ = pad_list[2] + pad_list[3]; in Init() [all …]
|
D | conv3d_grad_input_gpu_kernel.h | 112 std::vector<int> pad_list; in Init() local 114 (void)std::transform(pad_list_me.begin(), pad_list_me.end(), std::back_inserter(pad_list), in Init() 116 if (pad_list.size() != 6) { in Init() 119 pad_depth_ = pad_list[0]; in Init() 120 pad_height_ = pad_list[2]; in Init() 121 pad_width_ = pad_list[4]; in Init() 122 …use_pad_ = !((pad_depth_ == pad_list[1]) && (pad_height_ == pad_list[3]) && (pad_width_ == pad_lis… in Init() 132 pad_depth_ = pad_list[0] + pad_list[1]; in Init() 133 pad_height_ = pad_list[2] + pad_list[3]; in Init() 134 pad_width_ = pad_list[4] + pad_list[5]; in Init() [all …]
|
D | conv3d_grad_filter_gpu_kernel.h | 137 std::vector<int> pad_list; in Init() local 139 (void)std::transform(pad_list_me.begin(), pad_list_me.end(), std::back_inserter(pad_list), in Init() 141 (void)CheckSize(pad_list.size(), 6, "pad_list"); in Init() 142 pad_depth_ = pad_list[0]; in Init() 143 pad_height_ = pad_list[2]; in Init() 144 pad_width_ = pad_list[4]; in Init() 145 …use_pad_ = !((pad_depth_ == pad_list[1]) && (pad_height_ == pad_list[3]) && (pad_width_ == pad_lis… in Init() 155 pad_depth_ = pad_list[0] + pad_list[1]; in Init() 156 pad_height_ = pad_list[2] + pad_list[3]; in Init() 157 pad_width_ = pad_list[4] + pad_list[5]; in Init() [all …]
|
D | conv2d_grad_input_gpu_kernel.h | 150 std::vector<int> pad_list; in Init() local 152 (void)std::transform(pad_list_me.begin(), pad_list_me.end(), std::back_inserter(pad_list), in Init() 154 if (pad_list.size() != 4) { in Init() 157 pad_height_ = pad_list[0]; in Init() 158 pad_width_ = pad_list[2]; in Init() 159 use_pad_ = !((pad_height_ == pad_list[1]) && (pad_width_ == pad_list[3])); in Init() 167 pad_height_ = pad_list[0] + pad_list[1]; in Init() 168 pad_width_ = pad_list[2] + pad_list[3]; in Init() 169 pad_top_ = pad_list[0]; in Init() 170 pad_left_ = pad_list[2]; in Init() [all …]
|
D | conv2d_gpu_kernel.h | 109 std::vector<int> pad_list; in Init() local 111 (void)std::transform(pad_list_me.begin(), pad_list_me.end(), std::back_inserter(pad_list), in Init() 113 if (pad_list.size() != 4) { in Init() 117 pad_height_ = pad_list[0]; in Init() 118 pad_width_ = pad_list[2]; in Init() 119 use_pad_ = !((pad_height_ == pad_list[1]) && (pad_width_ == pad_list[3])); in Init() 127 pad_height_ = pad_list[0] + pad_list[1]; in Init() 128 pad_width_ = pad_list[2] + pad_list[3]; in Init() 129 pad_top_ = pad_list[0]; in Init() 130 pad_left_ = pad_list[2]; in Init()
|
D | im2col_gpu_kernel.h | 207 std::vector<int> pad_list; in SetPad() local 209 (void)std::transform(pad_list_me.begin(), pad_list_me.end(), std::back_inserter(pad_list), in SetPad() 217 if (pad_list.size() != 4) { in SetPad() 218 …CEPTION) << "For 'Im2ColGpuKernel', the length of pad_list must be 4, but got " << pad_list.size(); in SetPad() 220 pad_height_ = pad_list[0] + pad_list[1]; in SetPad() 221 pad_width_n = pad_list[2] + pad_list[3]; in SetPad() 222 pad_top_ = pad_list[0]; in SetPad() 223 pad_left_ = pad_list[2]; in SetPad()
|
D | conv2d_grad_filter_gpu_kernel.h | 137 std::vector<int> pad_list; in Init() local 139 (void)std::transform(pad_list_me.begin(), pad_list_me.end(), std::back_inserter(pad_list), in Init() 141 if (pad_list.size() != 4) { in Init() 144 pad_height_ = pad_list[0]; in Init() 145 pad_width_ = pad_list[2]; in Init() 146 use_pad_ = !((pad_height_ == pad_list[1]) && (pad_width_ == pad_list[3])); in Init() 154 pad_height_ = pad_list[0] + pad_list[1]; in Init() 155 pad_width_ = pad_list[2] + pad_list[3]; in Init() 156 pad_top_ = pad_list[0]; in Init() 157 pad_left_ = pad_list[2]; in Init()
|
/third_party/mindspore/mindspore/_extends/graph_kernel/expanders/ |
D | conv2d.py | 92 pad_list = self.attrs['pad_list'] 94 check_nd(pad_list, 4) 95 self.has_pad = conv_had_pad(pad_list, pad_mode) 117 h0 = h0 + pad_list[0] + pad_list[1] 118 w0 = w0 + pad_list[2] + pad_list[3] 162 pad_list = self.attrs['pad_list'] 163 input_0_pad_before = [0, pad_list[0], pad_list[2], 0] 164 input_0_pad_after = [0, pad_list[1], pad_list[3], 0]
|
/third_party/mindspore/mindspore/_extends/graph_kernel/model/ |
D | op_infer.py | 353 def conv_had_pad(pad_list, pad_mode): argument 355 if not isinstance(pad_list, (list, tuple)) or len(pad_list) != 4: 356 raise GKException("pad_list should be 4D list or tuple, but got {}".format(pad_list)) 357 if pad_list[0] != pad_list[1] or pad_list[2] != pad_list[3]: 360 for _, pad in enumerate(pad_list): 384 pad_list = self.attrs["pad_list"] 389 check_nd(pad_list, 4) 394 has_pad = conv_had_pad(pad_list, pad_mode) 396 pad_list = [0, 0, 0, 0] 400 out_h = (h + pad_list[0] + pad_list[1] - k_h) // stride[-2] + 1 [all …]
|
/third_party/mindspore/mindspore/core/ops/fusion/ |
D | conv2d_fusion.cc | 27 … const std::vector<int64_t> &pad_list, const ActivationType &activation_type) { in Init() argument 38 this->set_pad_list(pad_list); in Init() 42 void Conv2DFusion::set_pad_list(const std::vector<int64_t> &pad_list) { in set_pad_list() argument 43 (void)this->AddAttr(kPadList, MakeValue(pad_list)); in set_pad_list()
|
/third_party/mindspore/mindspore/core/abstract/ |
D | prim_nn.cc | 203 void Conv2DPadFunction(std::vector<int64_t> *output_hw, std::vector<int64_t> *pad_list, const int64… in Conv2DPadFunction() argument 211 (void)pad_list->insert(pad_list->begin(), nhwc, 0); in Conv2DPadFunction() 217 pad_list->push_back(static_cast<int64_t>(std::floor(pad_needed_h / 2))); in Conv2DPadFunction() 218 pad_list->push_back(pad_needed_h - pad_list->at(0)); in Conv2DPadFunction() 221 pad_list->push_back(static_cast<int64_t>(std::floor(pad_needed_w / 2))); in Conv2DPadFunction() 222 pad_list->push_back(pad_needed_w - pad_list->at(2)); in Conv2DPadFunction() 224 (void)pad_list->insert(pad_list->begin(), padding.begin(), padding.end()); in Conv2DPadFunction() 226 …1 + ((x_h * 1.0) + pad_list->at(0) + pad_list->at(1) - kernel[0] - (kernel[0] - 1) * (dilation[0] … in Conv2DPadFunction() 229 …1 + ((x_w * 1.0) + pad_list->at(2) + pad_list->at(3) - kernel[1] - (kernel[1] - 1) * (dilation[1] … in Conv2DPadFunction() 301 std::vector<int64_t> pad_list; in InferImplConv2D() local [all …]
|
/third_party/mindspore/mindspore/core/ops/grad/ |
D | conv2d_backprop_input.cc | 45 ShapeVector pad_list = {0, 0, 0, 0}; in SetPadList() local 47 pad_list = GetValue<ShapeVector>(attr_pad_list_prt); in SetPadList() 75 pad_list = {pad_top, pad_bottom, pad_left, pad_right}; in SetPadList() 77 pad_list = GetValue<std::vector<int64_t>>(primitive->GetAttr(kPad)); in SetPadList() 79 (void)primitive->AddAttr(kPadList, MakeValue(pad_list)); in SetPadList() 176 const Format &format, const std::vector<int64_t> &pad_list) { in Init() argument 186 set_pad_list(pad_list); in Init() 238 void Conv2DBackpropInput::set_pad_list(const std::vector<int64_t> &pad_list) { in set_pad_list() argument 239 (void)this->AddAttr(kPadList, MakeValue(pad_list)); in set_pad_list()
|
D | pooling_grad.cc | 24 … const std::vector<int64_t> &pad_list, const RoundMode &round_mode, const Format &format, in Init() argument 30 set_pad_list(pad_list); in Init() 73 void PoolingGrad::set_pad_list(const std::vector<int64_t> &pad_list) { in set_pad_list() argument 74 (void)this->AddAttr(kPadList, MakeValue(pad_list)); in set_pad_list()
|
/third_party/mindspore/mindspore/lite/src/delegate/npu/op/ |
D | convolution_depthwise_npu.cc | 36 auto pad_u = static_cast<int>(*(conv_prim->pad_list()->begin() + PAD_UP)); in SetConvDwParam() 37 auto pad_d = static_cast<int>(*(conv_prim->pad_list()->begin() + PAD_DOWN)); in SetConvDwParam() 38 auto pad_l = static_cast<int>(*(conv_prim->pad_list()->begin() + PAD_LEFT)); in SetConvDwParam() 39 auto pad_r = static_cast<int>(*(conv_prim->pad_list()->begin() + PAD_RIGHT)); in SetConvDwParam()
|
D | deconvolution_npu.cc | 60 auto pad_u = static_cast<int>(*(conv_prim->pad_list()->begin() + PAD_UP)); in SetDeconvParam() 61 auto pad_d = static_cast<int>(*(conv_prim->pad_list()->begin() + PAD_DOWN)); in SetDeconvParam() 62 auto pad_l = static_cast<int>(*(conv_prim->pad_list()->begin() + PAD_LEFT)); in SetDeconvParam() 63 auto pad_r = static_cast<int>(*(conv_prim->pad_list()->begin() + PAD_RIGHT)); in SetDeconvParam()
|