ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Mean.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved
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
18
19using namespace onert_micro;
20using namespace onert_micro::core;
21
22namespace
23{
24
25constexpr uint32_t inputTensorIdx = 0;
26constexpr uint32_t axisTensorIdx = 1;
27constexpr uint32_t outputTensorIdx = 0;
28
29} // namespace
30
31namespace onert_micro
32{
33namespace import
34{
35
37{
38 OMRuntimeContext &runtime_context = config_args.runtime_context;
39 uint16_t op_index = config_args.kernel_index;
40
42
43 OMStatus status = runtime_kernel.readKernel(op_index, runtime_context);
44 if (status != Ok)
45 return status;
46
47 const circle::Tensor *input = runtime_kernel.inputs[inputTensorIdx];
48 const circle::Tensor *axis = runtime_kernel.inputs[axisTensorIdx];
49 const circle::Tensor *output = runtime_kernel.outputs[outputTensorIdx];
50
51 assert(input != nullptr);
52 assert(axis != nullptr);
53 assert(output != nullptr);
54
55 status = utils::checkCondition(axis->type() == circle::TensorType_INT32);
56 status = utils::checkCondition(input->type() == output->type());
57
58 return status;
59}
60
61} // namespace import
62} // namespace onert_micro
OMStatus readKernel(uint16_t op_index, core::OMRuntimeContext &runtime_context)
const circle::Tensor * outputs[maxOutputSize]
const circle::Tensor * inputs[maxInputSize]
constexpr uint32_t outputTensorIdx
OMStatus configure_kernel_CircleMean(const OMConfigureArgs &config_args)
Definition Mean.cpp:36
core::OMRuntimeContext & runtime_context