code check

This commit is contained in:
zhaozhenlong 2021-09-16 10:26:53 +08:00
parent 75e7a5ebdc
commit 925583ac82
3 changed files with 3 additions and 4 deletions

View File

@ -147,6 +147,5 @@ int ConvolutionDepthwise3x3Fp16CPUKernel::Run() {
}
return RET_OK;
}
} // namespace mindspore::kernel
#endif

View File

@ -33,7 +33,7 @@ int SparseToDenseCPUKernel::Init() {
MS_CHECK_TRUE_RET(in_tensors_.size() == kInputSize2, RET_ERROR);
CHECK_NULL_RETURN(in_tensors_[0]);
CHECK_NULL_RETURN(in_tensors_[1]);
CHECK_NULL_RETURN(in_tensors_[2]);
CHECK_NULL_RETURN(in_tensors_[DIMENSION_2D]);
MS_CHECK_TRUE_RET(out_tensors_.size() == 1, RET_ERROR);
CHECK_NULL_RETURN(out_tensors_.front());
auto input2 = in_tensors_.at(2);

View File

@ -55,7 +55,7 @@ int SparseToDenseOpenCLKernel::InitOutputToDefault() {
int SparseToDenseOpenCLKernel::InitWeights() {
auto allocator = ocl_runtime_->GetAllocator();
MS_CHECK_GE(in_tensors_.size(), 3, RET_ERROR);
MS_CHECK_GE(in_tensors_.size(), DIMENSION_3D, RET_ERROR);
auto weight_tensor = in_tensors_[2];
size_t size = 1;
for (int i = 0; i < weight_tensor->shape().size(); ++i) {
@ -176,7 +176,7 @@ void SparseToDenseOpenCLKernel::SetGlobalLocal() {
int SparseToDenseOpenCLKernel::Prepare() {
enable_fp16_ = ocl_runtime_->GetFp16Enable();
input_dim_ = in_tensors_[0]->shape().size();
MS_CHECK_GE(input_dim_, 2, RET_ERROR);
MS_CHECK_GE(input_dim_, DIMENSION_2D, RET_ERROR);
inshapeindex1_dim = in_tensors_[0]->shape()[1];
weight_scalar_ = in_tensors_[2]->IsScalar();
const std::string kernel_name = "SparseToDense" + std::string(weight_scalar_ ? "Scalar" : "Vector");