forked from Samsung/ONE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[luci/service] Support RmsNorm operation (Samsung#14025)
This commit supports RmsNorm operation in luci service. ONE-DCO-1.0-Signed-off-by: Seockho Kim [email protected]
- Loading branch information
1 parent
804fa33
commit 10fbedb
Showing
5 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2024 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 *CloneNode::visit(const luci::CircleRmsNorm *node) | ||
{ | ||
auto *cloned = _graph->nodes()->create<luci::CircleRmsNorm>(); | ||
if (cloned != nullptr) | ||
{ | ||
cloned->epsilon(node->epsilon()); | ||
} | ||
return cloned; | ||
} | ||
|
||
} // namespace luci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2024 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_RmsNorm) | ||
{ | ||
auto g = loco::make_graph(); | ||
auto node_fc = g->nodes()->create<luci::CircleRmsNorm>(); | ||
node_fc->epsilon(3); | ||
|
||
auto gc = loco::make_graph(); | ||
auto cloned = luci::clone_node(node_fc, gc.get()); | ||
ASSERT_NE(nullptr, cloned); | ||
ASSERT_EQ(gc.get(), cloned->graph()); | ||
|
||
auto cloned_fc = dynamic_cast<luci::CircleRmsNorm *>(cloned); | ||
ASSERT_NE(nullptr, cloned_fc); | ||
ASSERT_EQ(node_fc->epsilon(), cloned_fc->epsilon()); | ||
} |