Browse Source

!14320 [MS_LITE] fix bug of issue

From: @YeFeng_24
Reviewed-by: @hangangqiang,@zhanghaibo5
Signed-off-by: @zhanghaibo5
pull/14320/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
9e2e365fd9
4 changed files with 15 additions and 2 deletions
  1. +8
    -0
      mindspore/lite/nnacl/fp32/arithmetic_fp32.c
  2. +1
    -0
      mindspore/lite/nnacl/fp32/arithmetic_fp32.h
  3. +3
    -0
      mindspore/lite/nnacl/infer/transpose_infer.c
  4. +3
    -2
      mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_fp32.cc

+ 8
- 0
mindspore/lite/nnacl/fp32/arithmetic_fp32.c View File

@@ -145,6 +145,14 @@ int ElementLogicalOr(const float *in0, const float *in1, float *out, int size) {
return NNACL_OK;
}

int ElementLogicalOrBool(const bool *in0, const bool *in1, bool *out, int size) {
int index = 0;
for (; index < size; index++) {
out[index] = (in0[index]) | (in1[index]);
}
return NNACL_OK;
}

int ElementMaximum(const float *in0, const float *in1, float *out, int size) {
int index = 0;
#ifdef ENABLE_NEON


+ 1
- 0
mindspore/lite/nnacl/fp32/arithmetic_fp32.h View File

@@ -42,6 +42,7 @@ int ElementLogicalAndBool(const bool *in0, const bool *in1, bool *out, int size)

/* logical or */
int ElementLogicalOr(const float *in0, const float *in1, float *out, int size);
int ElementLogicalOrBool(const bool *in0, const bool *in1, bool *out, int size);

/* max min */
int ElementMaximum(const float *in0, const float *in1, float *out, int size);


+ 3
- 0
mindspore/lite/nnacl/infer/transpose_infer.c View File

@@ -49,6 +49,9 @@ int TransposeInferShape(const TensorC *const *inputs, size_t inputs_size, Tensor
if (perm_tensor->shape_size_ == 0) {
return NNACL_INFER_INVALID;
}
if (perms_num != 0 && perm_data == NULL) {
return NNACL_INFER_INVALID;
}
int perm[MAX_SHAPE_SIZE];
size_t perm_size = 0;
for (size_t i = 0; i < perms_num; i++) {


+ 3
- 2
mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_fp32.cc View File

@@ -213,8 +213,8 @@ void ArithmeticCPUKernel::InitRunFunction(int primitive_type) {
ElementOptDivInt},
{PrimitiveType_LogicalAnd, schema::ActivationType_NO_ACTIVATION, ElementLogicalAnd, ElementLogicalAndInt,
ElementLogicalAndBool, nullptr, nullptr},
{PrimitiveType_LogicalOr, schema::ActivationType_NO_ACTIVATION, ElementLogicalOr, nullptr, nullptr, nullptr,
nullptr},
{PrimitiveType_LogicalOr, schema::ActivationType_NO_ACTIVATION, ElementLogicalOr, nullptr, ElementLogicalOrBool,
nullptr, nullptr},
{PrimitiveType_Maximum, schema::ActivationType_NO_ACTIVATION, ElementMaximum, ElementMaximumInt, nullptr, nullptr,
nullptr},
{PrimitiveType_Minimum, schema::ActivationType_NO_ACTIVATION, ElementMinimum, ElementMinimumInt, nullptr, nullptr,
@@ -435,6 +435,7 @@ REG_KERNEL(kCPU, kNumberTypeFloat32, PrimitiveType_LogicalAnd, LiteKernelCreator
REG_KERNEL(kCPU, kNumberTypeBool, PrimitiveType_LogicalAnd, LiteKernelCreator<ArithmeticCPUKernel>)
REG_KERNEL(kCPU, kNumberTypeInt32, PrimitiveType_LogicalAnd, LiteKernelCreator<ArithmeticCPUKernel>)
REG_KERNEL(kCPU, kNumberTypeFloat32, PrimitiveType_LogicalOr, LiteKernelCreator<ArithmeticCPUKernel>)
REG_KERNEL(kCPU, kNumberTypeBool, PrimitiveType_LogicalOr, LiteKernelCreator<ArithmeticCPUKernel>)
REG_KERNEL(kCPU, kNumberTypeFloat32, PrimitiveType_Maximum, LiteKernelCreator<ArithmeticCPUKernel>)
REG_KERNEL(kCPU, kNumberTypeFloat32, PrimitiveType_Minimum, LiteKernelCreator<ArithmeticCPUKernel>)
REG_KERNEL(kCPU, kNumberTypeInt32, PrimitiveType_Maximum, LiteKernelCreator<ArithmeticCPUKernel>)


Loading…
Cancel
Save