Merge pull request !6268 from zhanghaibo/mastertags/v1.0.0
| @@ -116,7 +116,7 @@ int DoMatMulInferShape(const TensorPtrVector &in_tensors, const TensorPtrVector | |||||
| int DoMatMul(const TensorPtrVector &in_tensors, const TensorPtrVector &out_tensors, Node *node, | int DoMatMul(const TensorPtrVector &in_tensors, const TensorPtrVector &out_tensors, Node *node, | ||||
| mindspore::lite::Allocator *allocator) { | mindspore::lite::Allocator *allocator) { | ||||
| if (in_tensors[0]->data_ == NULL || in_tensors[1]->data_ ==NULL) { | |||||
| if (in_tensors[0]->data_ == NULL || in_tensors[1]->data_ == NULL) { | |||||
| LITE_LOG_ERROR("input data is NULL!"); | LITE_LOG_ERROR("input data is NULL!"); | ||||
| return RET_PARAM_INVALID; | return RET_PARAM_INVALID; | ||||
| } | } | ||||
| @@ -68,7 +68,7 @@ void FusedBatchNormFp32MeanVar(const float *input, float momentum, float *run_me | |||||
| run_mean[f] = run_mean[f] / N; | run_mean[f] = run_mean[f] / N; | ||||
| run_var[f] = run_var[f] / N - run_mean[f] * run_mean[f]; | run_var[f] = run_var[f] / N - run_mean[f] * run_mean[f]; | ||||
| save_mean[f] = momentum * save_mean[f] + (1 - momentum) * run_mean[f]; | save_mean[f] = momentum * save_mean[f] + (1 - momentum) * run_mean[f]; | ||||
| float inv_var = 1.f/sqrt(run_var[f]+param->epsilon_); | |||||
| float inv_var = 1.f / sqrt(run_var[f] + param->epsilon_); | |||||
| save_inv_var[f] = momentum * save_inv_var[f] + (1 - momentum) * inv_var; | save_inv_var[f] = momentum * save_inv_var[f] + (1 - momentum) * inv_var; | ||||
| } | } | ||||
| } | } | ||||
| @@ -29,7 +29,7 @@ void FusedBatchNormFp32(const void *input, const void *scale, const void *offset | |||||
| const void *variance, BatchNormParameter *param, int task_id, void *output); | const void *variance, BatchNormParameter *param, int task_id, void *output); | ||||
| void FusedBatchNormFp32MeanVar(const float *input, float momentum, float *run_mean, float *run_var, | void FusedBatchNormFp32MeanVar(const float *input, float momentum, float *run_mean, float *run_var, | ||||
| BatchNormParameter *param, float *save_mean, float *save_var); | |||||
| BatchNormParameter *param, float *save_mean, float *save_var); | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -33,7 +33,7 @@ typedef struct SoftmaxCrossEntropyParameter { | |||||
| } SoftmaxCrossEntropyParameter; | } SoftmaxCrossEntropyParameter; | ||||
| void SoftmaxGrad(const float *input_ptr, const float *yt_ptr, float *output_ptr, float *sum_data, | void SoftmaxGrad(const float *input_ptr, const float *yt_ptr, float *output_ptr, float *sum_data, | ||||
| float *sum_mul, SoftmaxParameter *parameter); | |||||
| float *sum_mul, SoftmaxParameter *parameter); | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -17,7 +17,7 @@ | |||||
| #include "nnacl/arithmetic_common.h" | #include "nnacl/arithmetic_common.h" | ||||
| void DoSpaceToBatchNHWCInt8(const int8_t *input, int8_t *output, int *block_sizes, int *in_shape, | void DoSpaceToBatchNHWCInt8(const int8_t *input, int8_t *output, int *block_sizes, int *in_shape, | ||||
| int *out_shape) { | |||||
| int *out_shape) { | |||||
| int out_dim0 = out_shape[0]; | int out_dim0 = out_shape[0]; | ||||
| int out_dim1 = out_shape[1]; | int out_dim1 = out_shape[1]; | ||||
| int out_dim2 = out_shape[2]; | int out_dim2 = out_shape[2]; | ||||
| @@ -95,3 +95,14 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND (PLATFORM_ARM64 OR PLATFORM_ARM | |||||
| ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so) | ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so) | ||||
| endif () | endif () | ||||
| if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") | |||||
| if (PLATFORM_ARM64 OR PLATFORM_ARM32) | |||||
| add_custom_command(TARGET mindspore-lite POST_BUILD | |||||
| COMMAND ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip | |||||
| ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so) | |||||
| elseif (NOT WIN32) | |||||
| add_custom_command(TARGET mindspore-lite POST_BUILD | |||||
| COMMAND strip ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so) | |||||
| endif () | |||||
| endif () | |||||
| @@ -100,6 +100,5 @@ int BiasGrad::InferShape(std::vector<Tensor *> inputs, std::vector<Tensor *> out | |||||
| return RET_OK; | return RET_OK; | ||||
| } | } | ||||
| } // namespace lite | } // namespace lite | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -33,7 +33,7 @@ class SparseSoftmaxCrossEntropyWithLogitsCPUKernel : public LossKernel { | |||||
| const std::vector<lite::Tensor *> &outputs, | const std::vector<lite::Tensor *> &outputs, | ||||
| const lite::Context *ctx, | const lite::Context *ctx, | ||||
| const mindspore::lite::PrimitiveC *primitive) | const mindspore::lite::PrimitiveC *primitive) | ||||
| : LossKernel(parameter, inputs, outputs, ctx, primitive) , losses_(nullptr), sum_data_(nullptr) { | |||||
| : LossKernel(parameter, inputs, outputs, ctx, primitive), losses_(nullptr), sum_data_(nullptr) { | |||||
| param = reinterpret_cast<SoftmaxCrossEntropyParameter *>(parameter); | param = reinterpret_cast<SoftmaxCrossEntropyParameter *>(parameter); | ||||
| } | } | ||||
| ~SparseSoftmaxCrossEntropyWithLogitsCPUKernel() override { | ~SparseSoftmaxCrossEntropyWithLogitsCPUKernel() override { | ||||
| @@ -30,7 +30,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace lite { | namespace lite { | ||||
| struct QuantArg { | struct QuantArg { | ||||
| double scale; | double scale; | ||||
| int32_t zeroPoint; | int32_t zeroPoint; | ||||