/third_party/ffmpeg/tests/dnn/ |
D | dnn-layer-pad-test.c | 65 params.paddings[0][0] = 0; in test_with_mode_symmetric() 66 params.paddings[0][1] = 0; in test_with_mode_symmetric() 67 params.paddings[1][0] = 2; in test_with_mode_symmetric() 68 params.paddings[1][1] = 3; in test_with_mode_symmetric() 69 params.paddings[2][0] = 3; in test_with_mode_symmetric() 70 params.paddings[2][1] = 2; in test_with_mode_symmetric() 71 params.paddings[3][0] = 0; in test_with_mode_symmetric() 72 params.paddings[3][1] = 0; in test_with_mode_symmetric() 130 params.paddings[0][0] = 1; in test_with_mode_reflect() 131 params.paddings[0][1] = 2; in test_with_mode_reflect() [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/ |
D | mirror_pad_impl.cu | 44 int64_t paddings[MAX_PADDINGS * PADDING_SIZE]; // local and fixed size to keep in registers in MirrorPad() local 46 paddings[i] = 0; in MirrorPad() 48 extract_paddings(paddings_arg, padd_dim, paddings); in MirrorPad() 50 int ap1_x = paddings[WIDTH + LEFT]; in MirrorPad() 51 int ap2_x = paddings[WIDTH + LEFT] + old_width - 1; in MirrorPad() 52 int ap1_y = paddings[HEIGHT + TOP]; in MirrorPad() 53 int ap2_y = paddings[HEIGHT + TOP] + old_height - 1; in MirrorPad() 54 int ap1_channel = paddings[CHANNEL + LEFT]; in MirrorPad() 55 int ap2_channel = paddings[CHANNEL + LEFT] + old_channel - 1; in MirrorPad() 56 int ap1_batch = paddings[BATCH + LEFT]; in MirrorPad() [all …]
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/opencl/ |
D | space_to_batch_nd_tests.cc | 25 OpParameter *CreateParameter(const std::vector<int> &block_sizes, const std::vector<int> &paddings)… in CreateParameter() argument 28 EXPECT_LE(paddings.size(), 4); in CreateParameter() 32 for (int i = 0; i < paddings.size(); ++i) { in CreateParameter() 33 param->paddings_[i] = paddings[i]; in CreateParameter() 40 const std::vector<int> &paddings) { in InferShape() argument 43 output_shape[1] = (input_shape[1] + paddings[0] + paddings[1]) / block_sizes[0]; in InferShape() 44 output_shape[2] = (input_shape[2] + +paddings[2] + paddings[3]) / block_sizes[1]; in InferShape() 52 std::vector<int> paddings = {2, 2, 2, 2}; in TEST_F() local 53 auto output_shape = InferShape(input_shape, block_sizes, paddings); in TEST_F() 83 auto *param = CreateParameter(block_sizes, paddings); in TEST_F() [all …]
|
/third_party/ffmpeg/libavfilter/dnn/ |
D | dnn_backend_native_layer_pad.c | 36 params->paddings[i][0] = avio_rl32(model_file_context); in ff_dnn_load_layer_pad() 37 params->paddings[i][1] = avio_rl32(model_file_context); in ff_dnn_load_layer_pad() 52 static int before_get_buddy(int given, int paddings, LayerPadModeParam mode) in before_get_buddy() argument 55 return (2 * paddings - 1 - given); in before_get_buddy() 57 return (2 * paddings - given); in before_get_buddy() 94 int new_number = number + params->paddings[0][0] + params->paddings[0][1]; in ff_dnn_execute_layer_pad() 95 int new_height = height + params->paddings[1][0] + params->paddings[1][1]; in ff_dnn_execute_layer_pad() 96 int new_width = width + params->paddings[2][0] + params->paddings[2][1]; in ff_dnn_execute_layer_pad() 97 int new_channel = channel + params->paddings[3][0] + params->paddings[3][1]; in ff_dnn_execute_layer_pad() 130 float *dst = output + (n + params->paddings[0][0]) * new_hwc_stride in ff_dnn_execute_layer_pad() [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/ |
D | mirror_pad_grad_cpu_kernel.cc | 165 int64_t paddings[MAX_PADDINGS * PADDING_SIZE]; // local and fixed size to keep in registers in MirrorPadGrad_Width_Height() local 167 paddings[i] = 0; // init all to 0 in MirrorPadGrad_Width_Height() 169 extract_paddings(paddings_arg, padd_dim, paddings); in MirrorPadGrad_Width_Height() 171 int64_t ap1_x = paddings[WIDTH]; in MirrorPadGrad_Width_Height() 172 int64_t ap2_x = paddings[WIDTH] + dx_width - 1; in MirrorPadGrad_Width_Height() 173 int64_t ap1_y = paddings[HEIGHT]; in MirrorPadGrad_Width_Height() 174 int64_t ap2_y = paddings[HEIGHT] + dx_height - 1; in MirrorPadGrad_Width_Height() 178 const int64_t grad_x = (SizeToLong(pos) % dx_width) + paddings[WIDTH]; in MirrorPadGrad_Width_Height() 179 const int64_t grad_y = ((SizeToLong(pos) / dx_width) % dx_height) + paddings[HEIGHT]; in MirrorPadGrad_Width_Height() 230 int64_t paddings[MAX_PADDINGS * PADDING_SIZE]; // local and fixed size to keep in registers in MirrorPadGradBatchChannel() local [all …]
|
D | mirror_pad_cpu_kernel.cc | 139 int64_t paddings[MAX_PADDINGS * PADDING_SIZE]; // local and fixed size to keep in registers in LaunchKernel() local 141 paddings[i] = 0; in LaunchKernel() 143 extract_paddings(paddings_arg, padd_dim, paddings); in LaunchKernel() 145 int64_t ap1_x = paddings[WIDTH]; in LaunchKernel() 146 int64_t ap2_x = paddings[WIDTH] + old_width - 1; in LaunchKernel() 147 int64_t ap1_y = paddings[HEIGHT]; in LaunchKernel() 148 int64_t ap2_y = paddings[HEIGHT] + old_height - 1; in LaunchKernel() 149 int64_t ap1_channel = paddings[CHANNEL]; in LaunchKernel() 150 int64_t ap2_channel = paddings[CHANNEL] + old_channel - 1; in LaunchKernel() 151 int64_t ap1_batch = paddings[BATCH]; in LaunchKernel() [all …]
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/ |
D | pad_fp32_test.cc | 34 … float *output_data, PaddingMode mode, int *paddings, int padding_length, float constant_value, 61 … float *output_data, PaddingMode mode, int *paddings, int padding_length, float constant_value, in Prepare() argument 76 param_.paddings_[i] = paddings[i]; in Prepare() 81 paddings_tensor_.set_data(paddings); in Prepare() 104 int paddings[8] = {0, 0, 4, 4, 4, 4, 0, 0}; in TEST_F() local 107 Prepare(input_shape, output_shape, in_data, out_data, mode, paddings, 8, 0.0f, thread_num); in TEST_F() 146 int paddings[8] = {0, 0, 3, 3, 3, 3, 0, 0}; in TEST_F() local 149 Prepare(input_shape, output_shape, in_data, out_data, mode, paddings, 8, 0.0f, thread_num); in TEST_F() 181 int paddings[8] = {0, 0, 3, 3, 3, 3, 0, 0}; in TEST_F() local 185 Prepare(input_shape, output_shape, in_data, out_data, mode, paddings, 8, pad_value, thread_num); in TEST_F() [all …]
|
D | space_to_batch_fp32_tests.cc | 42 int paddings[] = {0, 0, 0, 0}; in TEST_F() local 44 …put.data(), out, in_shape.data(), out_shape.data(), in_stride, out_stride, blocks, paddings, 1, 0); in TEST_F() 63 int paddings[] = {0, 0, 0, 0}; in TEST_F() local 65 …put.data(), out, in_shape.data(), out_shape.data(), in_stride, out_stride, blocks, paddings, 1, 0); in TEST_F() 84 int paddings[] = {0, 0, 0, 0}; in TEST_F() local 86 …put.data(), out, in_shape.data(), out_shape.data(), in_stride, out_stride, blocks, paddings, 1, 0); in TEST_F()
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/fp16/ |
D | pad_fp16.c | 21 const int *paddings, int tid, int thread_num) { in PadFp16() argument 24 out[0] = in[0] + paddings[0]; in PadFp16() 26 out[1] = in[1] + paddings[2]; in PadFp16() 28 out[2] = in[2] + paddings[4]; in PadFp16() 30 out[3] = in[3] + paddings[6]; in PadFp16() 32 out[4] = in[4] + paddings[8]; in PadFp16() 33 float16_t *dst = output_data + Offset6d(output_shape, out) + paddings[10]; in PadFp16()
|
/third_party/mindspore/mindspore/core/ops/ |
D | space_to_batch.cc | 37 auto paddings = GetValue<std::vector<std::vector<int64_t>>>(primitive->GetAttr(kPaddings)); in InferShape() local 40 auto padded = output_shape[i + kDimsOffset] + paddings[i][0] + paddings[i][1]; in InferShape() 59 void SpaceToBatch::set_paddings(const std::vector<std::vector<int64_t>> &paddings) { in set_paddings() argument 60 (void)this->AddAttr(kPaddings, MakeValue(paddings)); in set_paddings() 61 int64_t h = SizeToLong(paddings.size()); in set_paddings() 62 int64_t w = SizeToLong(paddings[0].size()); in set_paddings() 67 …(void)CheckAndConvertUtils::CheckInteger(kPadding, paddings[i][j], kGreaterEqual, 0, this->name()); in set_paddings() 84 …h::Init(const std::vector<int64_t> block_size, const std::vector<std::vector<int64_t>> &paddings) { in Init() argument 85 this->set_paddings(paddings); in Init()
|
D | space_to_batch_nd.cc | 63 void SpaceToBatchND::set_paddings(std::vector<std::vector<int64_t>> paddings) { in set_paddings() argument 65 …(void)CheckAndConvertUtils::CheckInteger(kPaddings, SizeToLong(paddings.size()), kEqual, pad_size,… in set_paddings() 66 size_t h = paddings.size(); in set_paddings() 67 size_t w = paddings[0].size(); in set_paddings() 72 …(void)CheckAndConvertUtils::CheckInteger(kPaddings, paddings[i][j], kGreaterEqual, 0LL, this->name… in set_paddings() 75 (void)this->AddAttr(kPaddings, MakeValue(paddings)); in set_paddings() 96 …D::Init(const std::vector<int64_t> block_shape, const std::vector<std::vector<int64_t>> paddings) { in Init() argument 97 this->set_paddings(paddings); in Init()
|
/third_party/mindspore/mindspore/lite/src/ops/populate/ |
D | space_to_batch_nd_populate.cc | 50 auto param_paddings = value->paddings(); in PopulateSpaceToBatchNDParameter() 79 std::vector<int64_t> paddings; in PopulateSpaceToBatchNDParameter() local 88 paddings.insert(paddings.end(), paddings_vec.begin(), paddings_vec.end()); in PopulateSpaceToBatchNDParameter() 90 if (paddings.size() > COMM_SHAPE_SIZE) { in PopulateSpaceToBatchNDParameter() 91 MS_LOG(ERROR) << "Invalid paddings size " << paddings.size(); in PopulateSpaceToBatchNDParameter() 100 for (size_t i = 0; i < paddings.size(); ++i) { in PopulateSpaceToBatchNDParameter() 101 param->paddings_[i] = static_cast<int>(paddings[i]); in PopulateSpaceToBatchNDParameter()
|
D | space_to_batch_populate.cc | 53 auto param_paddings = value->paddings(); in PopulateSpaceToBatchParameter() 82 std::vector<int64_t> paddings; in PopulateSpaceToBatchParameter() local 91 paddings.insert(paddings.end(), paddings_vec.begin(), paddings_vec.end()); in PopulateSpaceToBatchParameter() 93 if (paddings.size() > COMM_SHAPE_SIZE) { in PopulateSpaceToBatchParameter() 94 MS_LOG(ERROR) << "Invalid paddings size " << paddings.size(); in PopulateSpaceToBatchParameter() 102 for (size_t i = 0; i < paddings.size(); ++i) { in PopulateSpaceToBatchParameter() 103 param->paddings_[i] = static_cast<int>(paddings[i]); in PopulateSpaceToBatchParameter()
|
/third_party/mindspore/tests/st/ops/gpu/ |
D | test_pad.py | 41 pad_op = nn.Pad(mode='CONSTANT', paddings=((1, 1), (1, 1))) 50 pad_op = nn.Pad(mode='CONSTANT', paddings=((1, 1), (1, 1))) 69 pad_op_row_1 = nn.Pad(mode='CONSTANT', paddings=test_paddings_1) 70 pad_op_row_2 = nn.Pad(mode='CONSTANT', paddings=test_paddings_2) 100 pad_op_col_1 = nn.Pad(mode='CONSTANT', paddings=test_paddings_1) 101 pad_op_col_2 = nn.Pad(mode='CONSTANT', paddings=test_paddings_2) 129 pad_op_3d = nn.Pad(mode='CONSTANT', paddings=test_paddings) 138 pad_op_3d = nn.Pad(mode='CONSTANT', paddings=test_paddings) 147 pad_op_3d = nn.Pad(mode='CONSTANT', paddings=test_paddings) 168 self.pad = nn.Pad(mode="CONSTANT", paddings=( [all …]
|
/third_party/mindspore/tests/st/ops/cpu/ |
D | test_pad.py | 41 pad_op = nn.Pad(mode='CONSTANT', paddings=((1, 1), (1, 1))) 50 pad_op = nn.Pad(mode='CONSTANT', paddings=((1, 1), (1, 1))) 69 pad_op_row_1 = nn.Pad(mode='CONSTANT', paddings=test_paddings_1) 70 pad_op_row_2 = nn.Pad(mode='CONSTANT', paddings=test_paddings_2) 100 pad_op_col_1 = nn.Pad(mode='CONSTANT', paddings=test_paddings_1) 101 pad_op_col_2 = nn.Pad(mode='CONSTANT', paddings=test_paddings_2) 129 pad_op_3d = nn.Pad(mode='CONSTANT', paddings=test_paddings) 138 pad_op_3d = nn.Pad(mode='CONSTANT', paddings=test_paddings) 147 pad_op_3d = nn.Pad(mode='CONSTANT', paddings=test_paddings) 168 self.pad = nn.Pad(mode="CONSTANT", paddings=( [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/fp32/ |
D | pad_fp32.c | 22 const int *paddings, int tid, int thread_num) { in Pad() argument 28 out[0] = in[0] + paddings[0]; in Pad() 30 out[1] = in[1] + paddings[2]; in Pad() 32 out[2] = in[2] + paddings[4]; in Pad() 34 out[3] = in[3] + paddings[6]; in Pad() 36 out[4] = in[4] + paddings[8]; in Pad() 37 float *dst = output_data + Offset6d(output_shape, out) + paddings[10]; in Pad()
|
/third_party/mindspore/mindspore/lite/src/ops/populate/v0/ |
D | space_to_batch_populate_v0.cc | 52 auto paddings = space_to_batch_prim->paddings(); in PopulateSpaceToBatchParameter() local 53 if (paddings == nullptr) { in PopulateSpaceToBatchParameter() 58 if (paddings->size() > COMM_SHAPE_SIZE) { in PopulateSpaceToBatchParameter() 63 memcpy(space_batch_param->paddings_, (paddings->data()), paddings->size() * sizeof(int)); in PopulateSpaceToBatchParameter()
|
D | space_to_batch_nd_populate_v0.cc | 52 auto paddings = space_to_batch_nd_prim->paddings(); in PopulateSpaceToBatchNDParameter() local 53 if (paddings == nullptr) { in PopulateSpaceToBatchNDParameter() 58 if (((size_t)paddings->size()) > COMM_SHAPE_SIZE) { in PopulateSpaceToBatchNDParameter() 63 memcpy(space_batch_param_nd->paddings_, (paddings->data()), paddings->size() * sizeof(int)); in PopulateSpaceToBatchNDParameter()
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/int8/ |
D | pad_int8.cc | 186 int PadInt8CPUKernel::ExtendPaddings(int *paddings, int length, const int *ori_paddings, int ori_le… in ExtendPaddings() argument 187 if (paddings == nullptr || ori_paddings == nullptr) { in ExtendPaddings() 191 paddings[i] = 0; in ExtendPaddings() 194 paddings[i] = ori_paddings[i - (length - ori_length)]; in ExtendPaddings() 225 int PadInt8CPUKernel::CheckPaddings(const int *paddings, int length, const int *input_shape, int mo… in CheckPaddings() argument 226 if (paddings == nullptr || input_shape == nullptr) { in CheckPaddings() 240 if (paddings[i * 2] > max_valid) { in CheckPaddings() 241 …MS_LOG(WARNING) << prefix << "paddings " << paddings[i * 2] << "should be more than " << max_valid… in CheckPaddings() 243 if (paddings[i * 2 + 1] > max_valid) { in CheckPaddings() 244 …MS_LOG(WARNING) << prefix << "paddings " << paddings[i * 2 + 1] << "should be less than " << max_v… in CheckPaddings() [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/infer/ |
D | space_to_batch_infer.c | 42 int *paddings = param->paddings_; in SpaceToBatchInferShape() local 47 padding_left = paddings[2]; in SpaceToBatchInferShape() 48 padding_right = paddings[3]; in SpaceToBatchInferShape() 57 …outputs[0]->shape_[kNHWC_H] = (input->shape_[kNHWC_H] + paddings[0] + paddings[1]) / block_shape[0… in SpaceToBatchInferShape()
|
D | pad_infer.c | 38 const TensorC *paddings = inputs[1]; in PadInferShape() local 39 int size = GetElementNum(paddings); in PadInferShape() 43 if (paddings->data_ == NULL) { in PadInferShape() 48 param->paddings_[i] = ((int *)paddings->data_)[i]; in PadInferShape()
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/ |
D | pad_int8.c | 22 const int32_t *paddings, const int tid, const int thread_num) { in PadConstant4D() argument 31 …int8_t *out = out_data + Offset(out_dims, n + paddings[0], h + paddings[2], w + paddings[4], paddi… in PadConstant4D()
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/mindir/ |
D | space_batch_nd_attr_update.cc | 51 auto paddings = AnfAlgo::GetNodeAttr<std::vector<std::vector<int64_t>>>(node, kAttrPaddings); in Process() local 52 if (paddings.size() == kBlockShapeDimNum) { in Process() 53 paddings.emplace(paddings.begin(), std::vector<int64_t>{0, 0}); in Process() 54 AnfAlgo::SetNodeAttr(kAttrPaddings, MakeValue(paddings), node); in Process()
|
/third_party/mindspore/mindspore/lite/src/ops/compat/v0/ |
D | pad_compat_v0.cc | 40 auto paddings_attr = param->paddings(); in TransferPadAttr() 45 std::vector<int> paddings = std::vector<int>(paddings_attr->begin(), paddings_attr->end()); in TransferPadAttr() local 46 …auto paddings_tensor = AttrToTensor(paddings.data(), paddings.size(), true, kNumberTypeInt32, tens… in TransferPadAttr()
|
/third_party/mindspore/mindspore/lite/tools/converter/parser/onnx/ |
D | onnx_pad_parser.cc | 33 std::vector<std::vector<int64_t>> paddings(size / 2, std::vector<int64_t>(2, 0)); in Parse() local 37 paddings[i][0] = static_cast<int64_t>(onnx_node_attr.ints(i)); in Parse() 38 paddings[i][1] = static_cast<int64_t>(onnx_node_attr.ints(i + size / 2)); in Parse() 40 prim->set_paddings(paddings); in Parse()
|