Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class Algorithm final : public luci::CircleNodeVisitor<loco::TensorShape>
// 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class Algorithm final : public luci::CircleNodeVisitor<loco::DataType>
// 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;
Expand Down
1 change: 1 addition & 0 deletions compiler/luci/service/src/CircleCloneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ template <> class CloneNodeLet<CN::STUV> 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;
Expand Down
2 changes: 2 additions & 0 deletions compiler/luci/service/src/CircleShapeInferenceRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,8 @@ class ShapeInferenceAlgorithm final : public luci::CircleNodeVisitor<loco::NodeS

loco::NodeShape visit(const luci::CircleShape *node) final { return infer_shape(node); }

loco::NodeShape visit(const luci::CircleSign *node) final { return use_x(node); }

loco::NodeShape visit(const luci::CircleSin *node) final { return use_x(node); }

loco::NodeShape visit(const luci::CircleSlice *node) final { return infer_slice(node); }
Expand Down
2 changes: 2 additions & 0 deletions compiler/luci/service/src/CircleTypeInferenceRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ struct TypeInferenceAlgorithm final : public luci::CircleNodeVisitor<loco::DataT

loco::DataType visit(const luci::CircleShape *node) final { return node->out_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
Expand Down
27 changes: 27 additions & 0 deletions compiler/luci/service/src/Nodes/CircleSign.cpp
Original file line number Diff line number Diff line change
@@ -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<CN::STUV>::visit(const luci::CircleSign *)
{
return _graph->nodes()->create<luci::CircleSign>();
}

} // namespace luci
33 changes: 33 additions & 0 deletions compiler/luci/service/src/Nodes/CircleSign.test.cpp
Original file line number Diff line number Diff line change
@@ -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 <gtest/gtest.h>

TEST(CloneNodeTest, clone_Sign)
{
auto g = loco::make_graph();
auto node_sign = g->nodes()->create<luci::CircleSign>();

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<luci::CircleSign *>(cloned);
ASSERT_NE(nullptr, cloned_sign);
}