Skip to content

Commit

Permalink
refine frontend (PaddlePaddle#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
Superjomn committed Aug 14, 2020
1 parent 1a2b6ca commit 4ace494
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 35 deletions.
1 change: 0 additions & 1 deletion cinn/frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
set(srcs
syntax.cc
api.cc
)

cc_test(test_frontend_syntax SRCS syntax_test.cc DEPS core)
Expand Down
13 changes: 0 additions & 13 deletions cinn/frontend/api.cc

This file was deleted.

11 changes: 0 additions & 11 deletions cinn/frontend/api.h

This file was deleted.

15 changes: 5 additions & 10 deletions cinn/frontend/syntax.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,13 @@ struct _Variable_ : public common::Object {
static constexpr char* __type_info__ = "cinn_frontend_variable";
};

struct Variable {
explicit Variable(std::string_view id = "") {
auto* n = common::make_shared<_Variable_>();
n->id = id.empty() ? common::Context::Global().NewName("var") : id;
data_.Reset(n);
struct Variable : public common::Shared<_Variable_> {
explicit Variable(std::string_view id = "") : common::Shared<_Variable_>(common::make_shared<_Variable_>()) {
get()->id = id.empty() ? common::Context::Global().NewName("var") : id;
}

_Variable_* operator->() { return data_.get(); }
const _Variable_* operator->() const { return data_.get(); }

private:
common::Shared<_Variable_> data_;
_Variable_* operator->() { return get(); }
const _Variable_* operator->() const { return get(); }
};

struct _Instruction_ : public common::Object {
Expand Down

0 comments on commit 4ace494

Please sign in to comment.