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_SHAPE_SIGNATURE_H__
18 #define __LUCI_IR_SHAPE_SIGNATURE_H__
29 ShapeSignature() = default;
31 ShapeSignature(const std::vector<int32_t> &shape_signature)
33 _shape_signature = shape_signature;
37 const std::vector<int32_t> &as_vector() const { return _shape_signature; }
39 int32_t dim(uint32_t d) const { return _shape_signature.at(d); }
40 int32_t &dim(uint32_t d) { return _shape_signature.at(d); }
42 uint32_t rank(void) const { return _shape_signature.size(); }
43 void rank(uint32_t rank) { _shape_signature.resize(rank); }
46 std::vector<int32_t> _shape_signature{};
49 bool operator==(const ShapeSignature &lhs, const ShapeSignature &rhs);
53 #endif // __LUCI_IR_SHAPE_SIGNATURE_H__