Browse Source

!8440 fix resize issues of reshape and conv2d lite ops

From: @liuwenhao4
Reviewed-by: @zhang_xue_tong,@zhanghaibo5
Signed-off-by: @zhang_xue_tong
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
bedc733e42
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      mindspore/lite/src/ops/conv2d.cc
  2. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/int8/reshape_int8.cc

+ 2
- 2
mindspore/lite/src/ops/conv2d.cc View File

@@ -390,8 +390,8 @@ int Conv2D::InferShape(std::vector<Tensor *> inputs_, std::vector<Tensor *> outp
this->ConvInferShape(input_h, input_w, &output_h, &output_w); this->ConvInferShape(input_h, input_w, &output_h, &output_w);


std::vector<int> out_shape{input_tensor->shape()}; std::vector<int> out_shape{input_tensor->shape()};
out_shape.at(1) = output_h;
out_shape.at(2) = output_w;
out_shape.at(1) = output_h > 0 ? output_h : 1;
out_shape.at(2) = output_w > 0 ? output_w : 1;
out_shape.at(3) = weight_tensor->shape()[0]; out_shape.at(3) = weight_tensor->shape()[0];
out_tensor->set_shape(out_shape); out_tensor->set_shape(out_shape);




+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/int8/reshape_int8.cc View File

@@ -51,7 +51,7 @@ int ReshapeInt8CPUKernel::Init() {
int ReshapeInt8CPUKernel::ReSize() { return 0; } int ReshapeInt8CPUKernel::ReSize() { return 0; }


int ReshapeInt8CPUKernel::Run() { int ReshapeInt8CPUKernel::Run() {
MS_ASSERT(in_tensors_.size() == 1);
MS_ASSERT(in_tensors_.size() == 1 || in_tensors_.size() == 2);
MS_ASSERT(out_tensors_.size() == 1); MS_ASSERT(out_tensors_.size() == 1);
input_data_ = static_cast<int8_t *>(in_tensors_.at(kInputIndex)->MutableData()); input_data_ = static_cast<int8_t *>(in_tensors_.at(kInputIndex)->MutableData());
output_data_ = static_cast<int8_t *>(out_tensors_.at(kOutputIndex)->MutableData()); output_data_ = static_cast<int8_t *>(out_tensors_.at(kOutputIndex)->MutableData());


Loading…
Cancel
Save