2 * Copyright (c) 2020 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_IR_CIRCLECONST_H__
18 #define __LUCI_IR_CIRCLECONST_H__
20 #include "luci/IR/CircleNodeDecl.h"
21 #include "luci/IR/CircleOpcode.h"
23 #include "luci/IR/LuciNodeMixins.h"
25 #include <loco/IR/DataTypeTraits.h>
31 * @brief Class to build tensor data
32 * @note This will not be exported as a specific op
34 class CircleConst final : public FixedArityNode<0, CircleNodeImpl<CircleOpcode::CIRCLECONST>>
37 CircleConst() = default;
40 template <loco::DataType DT> uint32_t size(void) const;
41 template <loco::DataType DT> void size(uint32_t size);
42 template <loco::DataType DT> const typename loco::DataTypeImpl<DT>::Type &at(uint32_t n) const;
43 template <loco::DataType DT> typename loco::DataTypeImpl<DT>::Type &at(uint32_t n);
45 template <loco::DataType DT> const typename loco::DataTypeImpl<DT>::Type &scalar(void) const;
46 template <loco::DataType DT> typename loco::DataTypeImpl<DT>::Type &scalar(void);
49 std::vector<uint8_t> _data;
54 #endif // __LUCI_IR_CIRCLECONST_H__