!31538 [MSLITE] clean code checker: magic number and format
Merge pull request !31538 from 刘力力/master
This commit is contained in:
commit
9a5e8c4048
|
@ -14,15 +14,17 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "nnacl/op_base.h"
|
||||||
|
|
||||||
#include "experiment/kernel/convolution_fp32.h"
|
#include "experiment/kernel/convolution_fp32.h"
|
||||||
|
|
||||||
namespace mindspore::kernel {
|
namespace mindspore::kernel {
|
||||||
ConvolutionCPUFp32::ConvolutionCPUFp32(OpParameter *parameter, std::vector<lite::Tensor *> in_tensors,
|
ConvolutionCPUFp32::ConvolutionCPUFp32(OpParameter *parameter, std::vector<lite::Tensor *> in_tensors,
|
||||||
std::vector<lite::Tensor *> out_tensors, const lite::Context *ctx)
|
std::vector<lite::Tensor *> out_tensors, const lite::Context *ctx)
|
||||||
: InnerKernel(parameter, in_tensors, out_tensors, ctx) {
|
: InnerKernel(parameter, in_tensors, out_tensors, ctx) {
|
||||||
TensorC *in[4];
|
TensorC *in[C4NUM];
|
||||||
size_t insize = 0;
|
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();
|
in[insize] = &in_tensors[insize]->TensorC();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,5 +58,4 @@ int ConvolutionCPUFp32::PreProcess() {
|
||||||
int ConvolutionCPUFp32::Run() { return kernel->compute(kernel); }
|
int ConvolutionCPUFp32::Run() { return kernel->compute(kernel); }
|
||||||
|
|
||||||
int ConvolutionCPUFp32::PostProcess() { return kernel->compute(kernel); }
|
int ConvolutionCPUFp32::PostProcess() { return kernel->compute(kernel); }
|
||||||
|
|
||||||
} // namespace mindspore::kernel
|
} // namespace mindspore::kernel
|
||||||
|
|
|
@ -250,7 +250,7 @@ int GruCPUKernel::Run() {
|
||||||
int check_seq_len = gru_param_->seq_len_;
|
int check_seq_len = gru_param_->seq_len_;
|
||||||
|
|
||||||
if (in_tensors_.size() == 6) {
|
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);
|
CHECK_NULL_RETURN(seq_len);
|
||||||
if (!std::equal(seq_len + 1, seq_len + gru_param_->batch_, 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";
|
MS_LOG(ERROR) << "different batch seq_len is currently not supported";
|
||||||
|
|
Loading…
Reference in New Issue