diff --git a/mindspore/lite/nnacl/fp32/resize.c b/mindspore/lite/nnacl/fp32/resize.c index 8502bc1f88..568bfb7584 100644 --- a/mindspore/lite/nnacl/fp32/resize.c +++ b/mindspore/lite/nnacl/fp32/resize.c @@ -65,8 +65,8 @@ int PrepareResizeBilinear(const int *input_shape, const int *output_shape, bool } int ResizeBilinear(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, - const int *y_bottoms, const int *y_tops, int *x_lefts, int *x_rights, const float *y_bottom_weights, - float *x_left_weights, int n_h_begin, int n_h_end) { + const int *y_bottoms, const int *y_tops, const int *x_lefts, const int *x_rights, + const float *y_bottom_weights, float *x_left_weights, int n_h_begin, int n_h_end) { if (input_data == NULL || output_data == NULL || input_shape == NULL || output_shape == NULL || y_bottoms == NULL || y_tops == NULL || x_lefts == NULL || x_rights == NULL || y_bottom_weights == NULL || x_left_weights == NULL) { return NNACL_NULL_PTR; @@ -208,8 +208,9 @@ int InterpCol(const float *bottom_line, const float *top_line, float *output, in } int ResizeBilinear2(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, - const int *y_bottoms, const int *y_tops, int *x_lefts, int *x_rights, const float *y_bottom_weights, - float *x_left_weights, float *line0, float *line1, int n_h_begin, int n_h_end) { + const int *y_bottoms, const int *y_tops, const int *x_lefts, const int *x_rights, + const float *y_bottom_weights, float *x_left_weights, float *line0, float *line1, int n_h_begin, + int n_h_end) { if (input_data == NULL || output_data == NULL || input_shape == NULL || output_shape == NULL || y_bottoms == NULL || y_tops == NULL || x_lefts == NULL || x_rights == NULL || y_bottom_weights == NULL || x_left_weights == NULL) { return NNACL_NULL_PTR; diff --git a/mindspore/lite/nnacl/fp32/resize.h b/mindspore/lite/nnacl/fp32/resize.h index 8b9b939822..375b43e459 100644 --- a/mindspore/lite/nnacl/fp32/resize.h +++ b/mindspore/lite/nnacl/fp32/resize.h @@ -30,12 +30,13 @@ int PrepareResizeBilinear(const int *input_shape, const int *output_shape, bool int *y_tops, int *x_lefts, int *x_rights, float *y_bottom_weights, float *x_left_weights); int ResizeBilinear(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, - const int *y_bottoms, const int *y_tops, int *x_lefts, int *x_rights, const float *y_bottom_weights, - float *x_left_weights, int n_h_begin, int n_h_end); + const int *y_bottoms, const int *y_tops, const int *x_lefts, const int *x_rights, + const float *y_bottom_weights, float *x_left_weights, int n_h_begin, int n_h_end); int ResizeBilinear2(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, - const int *y_bottoms, const int *y_tops, int *x_lefts, int *x_rights, const float *y_bottom_weights, - float *x_left_weights, float *line0, float *line1, int n_h_begin, int n_h_end); + const int *y_bottoms, const int *y_tops, const int *x_lefts, const int *x_rights, + const float *y_bottom_weights, float *x_left_weights, float *line0, float *line1, int n_h_begin, + int n_h_end); int ResizeNearestNeighbor(const float *input_data, float *output_data, const int *input_shape, const int *output_shape, bool align_corners, int tid, int thread_num); diff --git a/mindspore/lite/nnacl/fp32/scale.c b/mindspore/lite/nnacl/fp32/scale.c index a898c97457..03cc7bf3b7 100644 --- a/mindspore/lite/nnacl/fp32/scale.c +++ b/mindspore/lite/nnacl/fp32/scale.c @@ -65,7 +65,7 @@ void ScaleAxis(const float *in_data, float *out_data, const float *scale, const } } -void DoScale(const float *in_data, float *out_data, const float *scale, float *offset, int task_id, +void DoScale(const float *in_data, float *out_data, const float *scale, const float *offset, int task_id, ScaleParameter *scale_param) { int outer_step = UP_DIV(scale_param->outer_size_, scale_param->op_parameter_.thread_num_); int outer_start = task_id * outer_step; diff --git a/mindspore/lite/nnacl/fp32/scale.h b/mindspore/lite/nnacl/fp32/scale.h index 97ca61303f..495ae8e2eb 100644 --- a/mindspore/lite/nnacl/fp32/scale.h +++ b/mindspore/lite/nnacl/fp32/scale.h @@ -22,7 +22,7 @@ #ifdef __cplusplus extern "C" { #endif -void DoScale(const float *in_data, float *out_data, const float *scale, float *offset, int task_id, +void DoScale(const float *in_data, float *out_data, const float *scale, const float *offset, int task_id, ScaleParameter *scale_param); void DoScaleRelu(const float *in_data, float *out_data, const float *scale, const float *offset, int task_id, ScaleParameter *scale_param); diff --git a/mindspore/lite/nnacl/fp32/space_to_batch.c b/mindspore/lite/nnacl/fp32/space_to_batch.c index 10d2a9607d..68f880f61d 100644 --- a/mindspore/lite/nnacl/fp32/space_to_batch.c +++ b/mindspore/lite/nnacl/fp32/space_to_batch.c @@ -46,7 +46,7 @@ void DoSpaceToBatchNHWC(const float *input, float *output, const int *block_size } } -void DoSpaceToBatchPaddingNHWC(const float *input, float *output, int *in_shape, const int *padding, +void DoSpaceToBatchPaddingNHWC(const float *input, float *output, const int *in_shape, const int *padding, const int *out_shape) { int in_h = in_shape[1]; int in_w = in_shape[2]; diff --git a/mindspore/lite/nnacl/fp32/space_to_batch.h b/mindspore/lite/nnacl/fp32/space_to_batch.h index 4612f782a0..8c8bac087d 100644 --- a/mindspore/lite/nnacl/fp32/space_to_batch.h +++ b/mindspore/lite/nnacl/fp32/space_to_batch.h @@ -32,7 +32,7 @@ extern "C" { #endif void DoSpaceToBatchNHWC(const float *input, float *output, const int *block_sizes, const int *in_shape, const int *out_shape); -void DoSpaceToBatchPaddingNHWC(const float *input, float *output, int *in_shape, const int *padding, +void DoSpaceToBatchPaddingNHWC(const float *input, float *output, const int *in_shape, const int *padding, const int *out_shape); #ifdef __cplusplus } diff --git a/mindspore/lite/nnacl/int8/conv_depthwise_int8.c b/mindspore/lite/nnacl/int8/conv_depthwise_int8.c index caaf1c59ce..f12e365936 100644 --- a/mindspore/lite/nnacl/int8/conv_depthwise_int8.c +++ b/mindspore/lite/nnacl/int8/conv_depthwise_int8.c @@ -528,7 +528,7 @@ void DepthwiseBorderPixelInt8(int8_t *dst, const int8_t *src, const int16_t *wei void DepthwiseBorderInt8(int8_t *dst, const int8_t *src, const int16_t *weight, const int32_t *bias, int top, int bottom, int left, int right, const ConvParameter *conv_param, const SlidingWindowParam *sliding, int8_t *in_zp, int32_t *out_zp, const int *out_multiplier, - int *left_shift, const int *right_shift, int32_t *acc_min, int32_t *acc_max) { + const int *left_shift, const int *right_shift, int32_t *acc_min, int32_t *acc_max) { int8_t *dst_h = dst + top * sliding->out_h_step_; for (int oh = top; oh < bottom; oh++) { int ih = oh * conv_param->stride_h_ - conv_param->pad_u_; diff --git a/mindspore/lite/nnacl/transpose.c b/mindspore/lite/nnacl/transpose.c index 000c4b6b97..aa1f8fdb4d 100644 --- a/mindspore/lite/nnacl/transpose.c +++ b/mindspore/lite/nnacl/transpose.c @@ -18,7 +18,7 @@ #include #include "nnacl/errorcode.h" -void TransposeDim2(float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, +void TransposeDim2(const float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, const int *output_shape, int h_start, int h_end) { const int stride0 = strides[perm[0]]; const int stride1 = strides[perm[1]]; @@ -33,7 +33,7 @@ void TransposeDim2(float *in_data, float *out_data, const int *strides, int *out } } -void TransposeDim3(float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, +void TransposeDim3(const float *in_data, float *out_data, const int *strides, const int *out_strides, const int *perm, const int *output_shape, int h_start, int h_end) { const int stride0 = strides[perm[0]]; const int stride1 = strides[perm[1]]; @@ -56,7 +56,7 @@ void TransposeDim3(float *in_data, float *out_data, const int *strides, int *out } } -void TransposeDim4(float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, +void TransposeDim4(const float *in_data, float *out_data, const int *strides, const int *out_strides, const int *perm, const int *output_shape, int h_start, int h_end) { const int stride0 = strides[perm[0]]; const int stride1 = strides[perm[1]]; @@ -88,7 +88,7 @@ void TransposeDim4(float *in_data, float *out_data, const int *strides, int *out } } -void TransposeDim5(float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, +void TransposeDim5(const float *in_data, float *out_data, const int *strides, const int *out_strides, const int *perm, const int *output_shape, int h_start, int h_end) { const int stride0 = strides[perm[0]]; const int stride1 = strides[perm[1]]; @@ -127,7 +127,7 @@ void TransposeDim5(float *in_data, float *out_data, const int *strides, int *out } } -void TransposeDims(float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, +void TransposeDims(const float *in_data, float *out_data, const int *strides, const int *out_strides, const int *perm, const int *output_shape, int h_start, int h_end, int dims, int *size, int *position) { *(size + dims - 1) = 1; for (int i = dims - 1; i > 0; --i) { @@ -149,7 +149,7 @@ void TransposeDims(float *in_data, float *out_data, const int *strides, int *out } } -int DoTranspose(float *in_data, float *out_data, int *input_shape, int *output_shape, +int DoTranspose(const float *in_data, float *out_data, int *input_shape, const int *output_shape, TransposeParameter *transpose_param, int h_start, int h_end, int *size, int *position) { if (in_data == NULL || out_data == NULL) { return NNACL_ERR; diff --git a/mindspore/lite/nnacl/transpose.h b/mindspore/lite/nnacl/transpose.h index c11c627c4b..ed71f0eb37 100644 --- a/mindspore/lite/nnacl/transpose.h +++ b/mindspore/lite/nnacl/transpose.h @@ -32,17 +32,17 @@ typedef struct TransposeParameter { #ifdef __cplusplus extern "C" { #endif -int DoTranspose(float *in_data, float *out_data, int *input_shape, int *output_shape, +int DoTranspose(const float *in_data, float *out_data, int *input_shape, const int *output_shape, TransposeParameter *transpose_param, int h_start, int h_end, int *size, int *position); -void TransposeDim2(float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, +void TransposeDim2(const float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, const int *output_shape, int h_start, int h_end); -void TransposeDim3(float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, +void TransposeDim3(const float *in_data, float *out_data, const int *strides, const int *out_strides, const int *perm, const int *output_shape, int h_start, int h_end); -void TransposeDim4(float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, +void TransposeDim4(const float *in_data, float *out_data, const int *strides, const int *out_strides, const int *perm, const int *output_shape, int h_start, int h_end); -void TransposeDim5(float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, +void TransposeDim5(const float *in_data, float *out_data, const int *strides, const int *out_strides, const int *perm, const int *output_shape, int h_start, int h_end); -void TransposeDims(float *in_data, float *out_data, const int *strides, int *out_strides, const int *perm, +void TransposeDims(const float *in_data, float *out_data, const int *strides, const int *out_strides, const int *perm, const int *output_shape, int h_start, int h_end, int dims, int *size, int *position); #ifdef __cplusplus } diff --git a/mindspore/lite/src/ops/binary_cross_entropy_grad.cc b/mindspore/lite/src/ops/binary_cross_entropy_grad.cc index 1e61641ef1..0248e09716 100644 --- a/mindspore/lite/src/ops/binary_cross_entropy_grad.cc +++ b/mindspore/lite/src/ops/binary_cross_entropy_grad.cc @@ -51,6 +51,7 @@ int BinaryCrossEntropyGrad::UnPackAttr(const Primitive &prim, const std::vector< if (attr == nullptr) { MS_LOG(ERROR) << "new binary cross entropy attr failed!"; delete this->primitive_; + this->primitive_ = nullptr; return RET_ERROR; } // default is mean