!31538 [MSLITE] clean code checker: magic number and format

Merge pull request !31538 from 刘力力/master
This commit is contained in:
i-robot 2022-03-21 03:32:48 +00:00 committed by Gitee
commit 9a5e8c4048
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 4 deletions

View File

@ -14,15 +14,17 @@
* limitations under the License.
*/
#include "nnacl/op_base.h"
#include "experiment/kernel/convolution_fp32.h"
namespace mindspore::kernel {
ConvolutionCPUFp32::ConvolutionCPUFp32(OpParameter *parameter, std::vector<lite::Tensor *> in_tensors,
std::vector<lite::Tensor *> out_tensors, const lite::Context *ctx)
: InnerKernel(parameter, in_tensors, out_tensors, ctx) {
TensorC *in[4];
TensorC *in[C4NUM];
size_t insize = 0;
for (; insize < in_tensors.size() && insize < 4; insize++) {
for (; insize < in_tensors.size() && insize < C4NUM; insize++) {
in[insize] = &in_tensors[insize]->TensorC();
}
@ -56,5 +58,4 @@ int ConvolutionCPUFp32::PreProcess() {
int ConvolutionCPUFp32::Run() { return kernel->compute(kernel); }
int ConvolutionCPUFp32::PostProcess() { return kernel->compute(kernel); }
} // namespace mindspore::kernel

View File

@ -250,7 +250,7 @@ int GruCPUKernel::Run() {
int check_seq_len = gru_param_->seq_len_;
if (in_tensors_.size() == 6) {
auto seq_len = reinterpret_cast<int *>(in_tensors_.at(5)->data());
auto seq_len = reinterpret_cast<int *>(in_tensors_.at(DIMENSION_5D)->data());
CHECK_NULL_RETURN(seq_len);
if (!std::equal(seq_len + 1, seq_len + gru_param_->batch_, seq_len)) {
MS_LOG(ERROR) << "different batch seq_len is currently not supported";