Browse Source

!14890 [CPU] Fix the bug of concat op when the input shape's value is zero

From: @zhanyuan1
Reviewed-by: @guoqi1024,@zhaizhiqiang
Signed-off-by: @zhaizhiqiang
pull/14890/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
7ccddab771
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      mindspore/ccsrc/backend/kernel_compiler/cpu/concat_cpu_kernel.cc

+ 3
- 0
mindspore/ccsrc/backend/kernel_compiler/cpu/concat_cpu_kernel.cc View File

@@ -53,6 +53,9 @@ bool ConcatCPUKernel<T>::Launch(const std::vector<kernel::AddressPtr> &inputs,
auto before_axis = input_flat_shape_list[0][0];
for (size_t i = 0; i < before_axis; ++i) {
for (size_t j = 0; j < input_num; ++j) {
if (input_flat_shape_list[j][1] == 0) {
continue;
}
auto input_j_addr = reinterpret_cast<T *>(inputs[j]->addr);
auto copy_num = input_flat_shape_list[j][1];
auto offset = copy_num * i;


Loading…
Cancel
Save