ONE - On-device Neural Engine
Loading...
Searching...
No Matches
GRU.h
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
17#ifndef LUCI_INTERPRETER_KERNELS_GRU_H
18#define LUCI_INTERPRETER_KERNELS_GRU_H
19
20#include "core/Kernel.h"
21#include "core/KernelParams.h"
22
23namespace luci_interpreter
24{
25namespace kernels
26{
27
28class GRU : public KernelWithParams<GRUParams>
29{
30public:
33 Tensor *output, const GRUParams &params);
34
35 const Tensor *input() const { return _inputs[0]; }
36 const Tensor *hidden_hidden() const { return _inputs[1]; }
37 const Tensor *hidden_hidden_bias() const { return _inputs[2]; }
38 const Tensor *hidden_input() const { return _inputs[3]; }
39 const Tensor *hidden_input_bias() const { return _inputs[4]; }
40 const Tensor *state() const { return _inputs[5]; }
41 Tensor *output() const { return _outputs[0]; }
42
43 void configure() override;
44 void execute() const override;
45
46private:
47 void evalFloat() const;
48};
49
50} // namespace kernels
51} // namespace luci_interpreter
52
53#endif // LUCI_INTERPRETER_KERNELS_ROPE_H
const std::vector< const Tensor * > _inputs
Definition Kernel.h:52
const std::vector< Tensor * > _outputs
Definition Kernel.h:53
void configure() override
Definition GRU.cpp:37
const Tensor * input() const
Definition GRU.h:35
void execute() const override
Definition GRU.cpp:48
const Tensor * hidden_input_bias() const
Definition GRU.h:39
const Tensor * hidden_input() const
Definition GRU.h:38
Tensor * output() const
Definition GRU.h:41
const Tensor * hidden_hidden_bias() const
Definition GRU.h:37
const Tensor * hidden_hidden() const
Definition GRU.h:36
const Tensor * state() const
Definition GRU.h:40