ONE - On-device Neural Engine
Loading...
Searching...
No Matches
CircleConst.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_CIRCLECONST_H__
18#define __LUCI_IR_CIRCLECONST_H__
19
22
24
26
27namespace luci
28{
29
34class CircleConst final : public FixedArityNode<0, CircleNodeImpl<CircleOpcode::CIRCLECONST>>
35{
36public:
37 template <loco::DataType DT> uint32_t size(void) const;
38 template <loco::DataType DT> void size(uint32_t size);
39 template <loco::DataType DT> const typename loco::DataTypeImpl<DT>::Type &at(uint32_t n) const;
40 template <loco::DataType DT> typename loco::DataTypeImpl<DT>::Type &at(uint32_t n);
41
42 template <loco::DataType DT> const typename loco::DataTypeImpl<DT>::Type &scalar(void) const;
43 template <loco::DataType DT> typename loco::DataTypeImpl<DT>::Type &scalar(void);
44
45private:
46 std::vector<uint8_t> _data;
47 // TODO use _data for STRING and remove _strings
48 std::vector<std::string> _strings; // for STRING type
49};
50
51} // namespace luci
52
53#endif // __LUCI_IR_CIRCLECONST_H__
Class to build tensor data.
Definition CircleConst.h:35
const loco::DataTypeImpl< DT >::Type & scalar(void) const
const loco::DataTypeImpl< DT >::Type & at(uint32_t n) const
uint32_t size(void) const
Nodes with the fixed number of inputs.
C++ scalar type corresponding to each DataType.