fix-codex
This commit is contained in:
parent
0dd9a8f374
commit
467d8d719d
|
@ -102,10 +102,11 @@ void LstsqCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs, cons
|
|||
MartixXd output = x * B;
|
||||
result = output;
|
||||
}
|
||||
for (size_t i = 0; i < n; i++)
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
for (size_t j = 0; j < k; j++) {
|
||||
*(output_addr + i * k + j) = static_cast<T2>(result(i, j));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Lstsq, LstsqCpuKernelMod);
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#define MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_LSTSQ_CPU_KERNEL_H_
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include "plugin/device/cpu/kernel/cpu_kernel.h"
|
||||
#include "plugin/factory/ms_factory.h"
|
||||
|
||||
|
|
|
@ -16,9 +16,6 @@
|
|||
|
||||
#ifndef MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_MATRIX_DETERMINANT_CPU_KERNEL_H_
|
||||
#define MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_MATRIX_DETERMINANT_CPU_KERNEL_H_
|
||||
#include <complex>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "plugin/device/cpu/kernel/cpu_kernel.h"
|
||||
#include "plugin/factory/ms_factory.h"
|
||||
|
|
|
@ -53,7 +53,9 @@ void MatrixDiagPartV3CpuKernelMod::InitKernel(const CNodePtr &kernel_node) {
|
|||
MS_LOG(EXCEPTION) << "Attr 'align' of 'MatrixDiagPartV3' is not in: 'LEFT_RIGHT', "
|
||||
"'RIGHT_LEFT', 'LEFT_LEFT', 'RIGHT_RIGHT'.";
|
||||
}
|
||||
if (align_ == "") align_ = "RIGHT_LEFT";
|
||||
if (align_ == "") {
|
||||
align_ = "RIGHT_LEFT";
|
||||
}
|
||||
} else {
|
||||
align_ = "RIGHT_LEFT";
|
||||
}
|
||||
|
@ -173,7 +175,7 @@ bool MatrixDiagPartV3CpuKernelMod::DoLaunch(const std::vector<kernel::AddressPtr
|
|||
|
||||
for (int64_t n = 0; n < diag_len; n++) {
|
||||
output_data[LongToSize(out_begin_index + offset + n)] = input_data[LongToSize(
|
||||
index_array * num_rows_ * num_cols_ + (n + col_offset) * num_cols_ + n + row_offset)];
|
||||
SizeToLong(index_array) * num_rows_ * num_cols_ + (n + col_offset) * num_cols_ + n + row_offset)];
|
||||
}
|
||||
const bool left_align = (offset == 0);
|
||||
const int64_t padding_start = (left_align) ? diag_len : 0;
|
||||
|
@ -290,8 +292,8 @@ std::vector<std::pair<KernelAttr, MatrixDiagPartV3CpuKernelMod::MatrixDiagPartV3
|
|||
|
||||
std::vector<KernelAttr> MatrixDiagPartV3CpuKernelMod::GetOpSupport() {
|
||||
std::vector<KernelAttr> support_list;
|
||||
std::transform(func_list_.begin(), func_list_.end(), std::back_inserter(support_list),
|
||||
[](const std::pair<KernelAttr, MatrixDiagPartV3Func> &pair) { return pair.first; });
|
||||
(void)std::transform(func_list_.begin(), func_list_.end(), std::back_inserter(support_list),
|
||||
[](const std::pair<KernelAttr, MatrixDiagPartV3Func> &pair) { return pair.first; });
|
||||
return support_list;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue