1 /**
2 * Copyright 2021 Huawei Technologies Co., Ltd
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 #include "src/runtime/kernel/arm/fp16/depth_to_space_fp16.h"
17 #include "schema/model_generated.h"
18 #include "src/kernel_registry.h"
19
20 using mindspore::lite::KernelRegistrar;
21 using mindspore::lite::RET_OK;
22 using mindspore::schema::PrimitiveType_DepthToSpace;
23
24 namespace mindspore::kernel {
Init()25 int DepthToSpaceFp16CPUKernel::Init() {
26 CHECK_LESS_RETURN(in_tensors_.size(), 1);
27 CHECK_LESS_RETURN(out_tensors_.size(), 1);
28 param_->data_type_size_ = sizeof(float16_t);
29 if (!InferShapeDone()) {
30 return RET_OK;
31 }
32 return ReSize();
33 }
34
35 REG_KERNEL(kCPU, kNumberTypeFloat16, PrimitiveType_DepthToSpace, LiteKernelCreator<DepthToSpaceFp16CPUKernel>)
36 } // namespace mindspore::kernel
37