2 * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef LUCI_INTERPRETER_KERNELS_SISO_KERNEL_H
18 #define LUCI_INTERPRETER_KERNELS_SISO_KERNEL_H
22 namespace luci_interpreter
27 // Single input single output kernel
31 SISOKernel(const circle::Operator *cur_op, BaseRuntimeGraph *runtime_graph)
33 const auto input_index = cur_op->inputs()->operator[](0);
34 const auto output_index = cur_op->outputs()->operator[](0);
36 assert(input_index != -1);
37 assert(output_index != -1);
39 _input_tensor = runtime_graph->getCircleTensorByIndex(input_index);
40 _output_tensor = runtime_graph->getCircleTensorByIndex(output_index);
42 assert(_input_tensor != nullptr);
43 assert(_output_tensor != nullptr);
46 const circle::Tensor *input() const { return _input_tensor; }
47 const circle::Tensor *output() const { return _output_tensor; }
50 const circle::Tensor *_input_tensor;
51 const circle::Tensor *_output_tensor;
54 } // namespace kernels
55 } // namespace luci_interpreter
57 #endif // LUCI_INTERPRETER_KERNELS_SISO_KERNEL_H