ONE - On-device Neural Engine
Loading...
Searching...
No Matches
CirclePack.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 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_IR_CIRCLEPACK_H__
18#define __LUCI_IR_CIRCLEPACK_H__
19
22
24
25#include <cassert>
26
27namespace luci
28{
29
33class CirclePack final : public VariadicArityNode<CircleNodeImpl<CircleOpcode::PACK>>
34{
35public:
37 {
38 // TODO Support when arity is 0
39 assert(arity >= 1);
40 }
41
42public:
43 uint32_t values_count(void) const { return arity(); }
44
45public:
46 Node *values(uint32_t index) const
47 {
48 assert(index < values_count());
49 return at(index)->node();
50 }
51 void values(uint32_t index, Node *node)
52 {
53 assert(index < values_count());
54 at(index)->node(node);
55 }
56
57public:
58 int32_t axis(void) const { return _axis; }
59 void axis(int32_t axis) { _axis = axis; }
60
61private:
62 int32_t _axis{0};
63};
64
65} // namespace luci
66
67#endif // __LUCI_IR_CIRCLEPACK_H__
Node()=default
Node * node(void) const
Definition Use.h:58
PACK in Circle.
Definition CirclePack.h:34
void values(uint32_t index, Node *node)
Definition CirclePack.h:51
Node * values(uint32_t index) const
Definition CirclePack.h:46
int32_t axis(void) const
Definition CirclePack.h:58
CirclePack(uint32_t arity)
Definition CirclePack.h:36
void axis(int32_t axis)
Definition CirclePack.h:59
uint32_t values_count(void) const
Definition CirclePack.h:43
Nodes with the variadic inputs.
uint32_t arity(void) const final
Return the number of arguments.