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_CIRCLE_SHAPE_SIGNATURE_INFERENCE_HELPER_H__
18 #define __LUCI_CIRCLE_SHAPE_SIGNATURE_INFERENCE_HELPER_H__
20 #include <luci/IR/CircleNodes.h>
21 #include <luci/IR/CircleShapeSignature.h>
26 namespace ssinf // Namespace for Shape Signature Inference
29 // Return empty signature if all of dimensions are known.
30 // If at least one of dimensions is unknown, return signature without change.
31 ShapeSignature legalized_signature(const luci::ShapeSignature &signature);
33 // Return reduced input_signature with indices and keep_dims.
34 // - indices : reduction index
35 // - keep_dims : If true, rank is not changed. If false, rank is reduced along indices.
36 ShapeSignature reduced_signature(const loco::Node *node, const loco::Node *indices, bool keep_dims);
38 // Return signature of index-th argument of node.
39 ShapeSignature input_arg_signature(const luci::CircleNode *node, uint32_t index);
45 #endif // __LUCI_CIRCLE_SHAPE_SIGNATURE_INFERENCE_HELPER_H__