Skip to content

Commit

Permalink
rebase and update name: CirGru -> GRU
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Balyshev committed Feb 21, 2024
1 parent 4764604 commit c5d7196
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion compiler/luci/lang/include/luci/IR/CircleNodes.lst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CIRCLE_NODE(GATHER_ND, CircleGatherNd)
CIRCLE_NODE(GELU, CircleGelu)
CIRCLE_NODE(GREATER, CircleGreater)
CIRCLE_NODE(GREATER_EQUAL, CircleGreaterEqual)
CIRCLE_NODE(CIR_GRU, CircleCirGru)
CIRCLE_NODE(GRU, CircleGRU)
CIRCLE_NODE(HARD_SWISH, CircleHardSwish)
CIRCLE_NODE(IF, CircleIf)
CIRCLE_NODE(L2_NORMALIZATION, CircleL2Normalize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#ifndef __LUCI_IR_CIRCLE_CIR_GRU_H__
#define __LUCI_IR_CIRCLE_CIR_GRU_H__
#ifndef __LUCI_IR_CIRCLE_GRU_H__
#define __LUCI_IR_CIRCLE_GRU_H__

#include "luci/IR/CircleNodeDecl.h"
#include "luci/IR/CircleOpcode.h"
Expand All @@ -28,7 +28,7 @@ namespace luci
/**
* @brief GRU in Circle
*/
class CircleCirGru final : public FixedArityNode<6, CircleNodeImpl<CircleOpcode::CIR_GRU>>
class CircleGRU final : public FixedArityNode<6, CircleNodeImpl<CircleOpcode::GRU>>
{
public:
loco::Node *input(void) const { return at(0)->node(); }
Expand Down Expand Up @@ -67,4 +67,4 @@ class CircleCirGru final : public FixedArityNode<6, CircleNodeImpl<CircleOpcode:

} // namespace luci

#endif // __LUCI_IR_CIRCLE_CIR_GRU_H__
#endif // __LUCI_IR_CIRCLE_GRU_H__
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
* limitations under the License.
*/

#include "luci/IR/Nodes/CircleCirGru.h"
#include "luci/IR/Nodes/CircleGRU.h"

#include "luci/IR/CircleDialect.h"
#include "luci/IR/CircleNodeVisitor.h"

#include <gtest/gtest.h>

TEST(CircleCirGruTest, constructor_P)
TEST(CircleGRUTest, constructor_P)
{
luci::CircleCirGru gru_node;
luci::CircleGRU gru_node;

ASSERT_EQ(luci::CircleDialect::get(), gru_node.dialect());
ASSERT_EQ(luci::CircleOpcode::CIR_GRU, gru_node.opcode());
ASSERT_EQ(luci::CircleOpcode::GRU, gru_node.opcode());

ASSERT_EQ(nullptr, gru_node.input());
ASSERT_EQ(nullptr, gru_node.hidden_hidden());
Expand All @@ -36,10 +36,10 @@ TEST(CircleCirGruTest, constructor_P)
ASSERT_EQ(nullptr, gru_node.state());
}

TEST(CircleCirGruTest, input_NEG)
TEST(CircleGRUTest, input_NEG)
{
luci::CircleCirGru gru_node;
luci::CircleCirGru node;
luci::CircleGRU gru_node;
luci::CircleGRU node;

gru_node.input(&node);
ASSERT_NE(nullptr, gru_node.input());
Expand All @@ -48,9 +48,9 @@ TEST(CircleCirGruTest, input_NEG)
ASSERT_EQ(nullptr, gru_node.input());
}

TEST(CircleCirGruTest, arity_NEG)
TEST(CircleGRUTest, arity_NEG)
{
luci::CircleCirGru gru_node;
luci::CircleGRU gru_node;

ASSERT_NO_THROW(gru_node.arg(0));
ASSERT_NO_THROW(gru_node.arg(1));
Expand All @@ -61,25 +61,25 @@ TEST(CircleCirGruTest, arity_NEG)
ASSERT_THROW(gru_node.arg(6), std::out_of_range);
}

TEST(CircleCirGruTest, visit_mutable_NEG)
TEST(CircleGRUTest, visit_mutable_NEG)
{
struct TestVisitor final : public luci::CircleNodeMutableVisitor<void>
{
};

luci::CircleCirGru gru_node;
luci::CircleGRU gru_node;

TestVisitor tv;
ASSERT_THROW(gru_node.accept(&tv), std::exception);
}

TEST(CircleCirGruTest, visit_NEG)
TEST(CircleGRUTest, visit_NEG)
{
struct TestVisitor final : public luci::CircleNodeVisitor<void>
{
};

luci::CircleCirGru gru_node;
luci::CircleGRU gru_node;

TestVisitor tv;
ASSERT_THROW(gru_node.accept(&tv), std::exception);
Expand Down

0 comments on commit c5d7196

Please sign in to comment.