diff --git a/compiler/luci/service/include/luci/Service/CircleShapeInference.h b/compiler/luci/service/include/luci/Service/CircleShapeInference.h index 0aaac56c620..82243c88947 100644 --- a/compiler/luci/service/include/luci/Service/CircleShapeInference.h +++ b/compiler/luci/service/include/luci/Service/CircleShapeInference.h @@ -134,6 +134,7 @@ class Algorithm final : public luci::CircleNodeVisitor // loco::TensorShape visit(const luci::CircleSelect *node) final; // loco::TensorShape visit(const luci::CircleSelectV2 *node) final; // loco::TensorShape visit(const luci::CircleShape *node) final; + // loco::TensorShape visit(const luci::CircleSign *node) final; // loco::TensorShape visit(const luci::CircleSin *node) final; // loco::TensorShape visit(const luci::CircleSlice *node) final; loco::TensorShape visit(const luci::CircleSoftmax *node) final; diff --git a/compiler/luci/service/include/luci/Service/CircleTypeInference.h b/compiler/luci/service/include/luci/Service/CircleTypeInference.h index 8db4c8f88a5..5311beeab3f 100644 --- a/compiler/luci/service/include/luci/Service/CircleTypeInference.h +++ b/compiler/luci/service/include/luci/Service/CircleTypeInference.h @@ -133,6 +133,7 @@ class Algorithm final : public luci::CircleNodeVisitor // loco::DataType visit(const luci::CircleSelect *node) final; // loco::DataType visit(const luci::CircleSelectV2 *node) final; // loco::DataType visit(const luci::CircleShape *node) final; + // loco::DataType visit(const luci::CircleSign *node) final; // loco::DataType visit(const luci::CircleSin *node) final; // loco::DataType visit(const luci::CircleSlice *node) final; // loco::DataType visit(const luci::CircleSoftmax *node) final; diff --git a/compiler/luci/service/src/CircleCloneNode.h b/compiler/luci/service/src/CircleCloneNode.h index 20b5f14ee04..fd38ded1167 100644 --- a/compiler/luci/service/src/CircleCloneNode.h +++ b/compiler/luci/service/src/CircleCloneNode.h @@ -201,6 +201,7 @@ template <> class CloneNodeLet final : public luci::CircleNodeVisitor< luci::CircleNode *visit(const luci::CircleSelect *) final; luci::CircleNode *visit(const luci::CircleSelectV2 *) final; luci::CircleNode *visit(const luci::CircleShape *) final; + luci::CircleNode *visit(const luci::CircleSign *) final; luci::CircleNode *visit(const luci::CircleSin *) final; luci::CircleNode *visit(const luci::CircleSlice *) final; luci::CircleNode *visit(const luci::CircleSoftmax *) final; diff --git a/compiler/luci/service/src/CircleShapeInferenceRule.cpp b/compiler/luci/service/src/CircleShapeInferenceRule.cpp index 321696384d8..9376aeea472 100644 --- a/compiler/luci/service/src/CircleShapeInferenceRule.cpp +++ b/compiler/luci/service/src/CircleShapeInferenceRule.cpp @@ -2084,6 +2084,8 @@ class ShapeInferenceAlgorithm final : public luci::CircleNodeVisitorout_type(); } + loco::DataType visit(const luci::CircleSign *node) final { return luci::dtype_get(node->x()); } + loco::DataType visit(const luci::CircleSin *node) final { return luci::dtype_get(node->x()); } loco::DataType visit(const luci::CircleSlice *node) final diff --git a/compiler/luci/service/src/Nodes/CircleSign.cpp b/compiler/luci/service/src/Nodes/CircleSign.cpp new file mode 100644 index 00000000000..5fa7aed3681 --- /dev/null +++ b/compiler/luci/service/src/Nodes/CircleSign.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2026 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CircleCloneNode.h" + +namespace luci +{ + +luci::CircleNode *CloneNodeLet::visit(const luci::CircleSign *) +{ + return _graph->nodes()->create(); +} + +} // namespace luci diff --git a/compiler/luci/service/src/Nodes/CircleSign.test.cpp b/compiler/luci/service/src/Nodes/CircleSign.test.cpp new file mode 100644 index 00000000000..8c117a3b707 --- /dev/null +++ b/compiler/luci/service/src/Nodes/CircleSign.test.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2026 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "luci/Service/CircleNodeClone.h" + +#include + +TEST(CloneNodeTest, clone_Sign) +{ + auto g = loco::make_graph(); + auto node_sign = g->nodes()->create(); + + auto gc = loco::make_graph(); + auto cloned = luci::clone_node(node_sign, gc.get()); + ASSERT_NE(nullptr, cloned); + ASSERT_EQ(gc.get(), cloned->graph()); + + auto cloned_sign = dynamic_cast(cloned); + ASSERT_NE(nullptr, cloned_sign); +}