ONE - On-device Neural Engine
Loading...
Searching...
No Matches
PALFullyConnected.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 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
17#ifndef LUCI_INTERPRETER_PAL_FULLYCONNECTED_H
18#define LUCI_INTERPRETER_PAL_FULLYCONNECTED_H
19
20#include <tensorflow/lite/kernels/internal/reference/fully_connected.h>
21#include <tensorflow/lite/kernels/internal/reference/integer_ops/fully_connected.h>
22
24{
25template <typename T>
26static inline void FullyConnected(const tflite::FullyConnectedParams &params,
27 const tflite::RuntimeShape &input_shape, const T *input_data,
28 const tflite::RuntimeShape &filter_shape, const T *filter_data,
29 const tflite::RuntimeShape &bias_shape, const int32_t *bias_data,
30 const tflite::RuntimeShape &output_shape, T *output_data)
31{
32 {
33 // MARK: At this moment this operation doesn't support
34 assert(false && "FullyConnected NYI");
35 (void)params;
36 (void)input_shape;
37 (void)input_data;
38 (void)filter_shape;
39 (void)filter_data;
40 (void)bias_shape;
41 (void)bias_data;
42 (void)output_shape;
43 (void)output_data;
44 }
45}
46
47template <>
48inline void
49FullyConnected<int8_t>(const tflite::FullyConnectedParams &params,
50 const tflite::RuntimeShape &input_shape, const int8_t *input_data,
51 const tflite::RuntimeShape &filter_shape, const int8_t *filter_data,
52 const tflite::RuntimeShape &bias_shape, const int32_t *bias_data,
53 const tflite::RuntimeShape &output_shape, int8_t *output_data)
54{
55 tflite::reference_integer_ops::FullyConnected(params, input_shape, input_data, filter_shape,
56 filter_data, bias_shape, bias_data, output_shape,
57 output_data);
58}
59} // namespace luci_interpreter_pal
60
61#endif // LUCI_INTERPRETER_PAL_FULLYCONNECTED_H
const luci_interpreter::RuntimeShape output_shape
void FullyConnected< int8_t >(const tflite::FullyConnectedParams &params, const tflite::RuntimeShape &input_shape, const int8_t *input_data, const tflite::RuntimeShape &filter_shape, const int8_t *filter_data, const tflite::RuntimeShape &bias_shape, const int32_t *bias_data, const tflite::RuntimeShape &output_shape, int8_t *output_data)
void FullyConnected(const FullyConnectedParams &params, const Shape &input_shape, const float *input_data, const Shape &weights_shape, const float *weights_data, const Shape &, const float *bias_data, const Shape &, float *output_data)