forked from mindspore-Ecosystem/mindspore
!22374 Add 'Create' method for api::FuncGraph
Merge pull request !22374 from hewei/core_user_api
This commit is contained in:
commit
3d10610bc9
|
@ -48,6 +48,8 @@ class MS_CORE_API FuncGraph {
|
|||
virtual FuncGraphManagerPtr get_manager() const = 0;
|
||||
|
||||
static std::vector<AnfNodePtr> TopoSort(const AnfNodePtr &node);
|
||||
|
||||
static FuncGraphPtr Create();
|
||||
};
|
||||
} // namespace mindspore::api
|
||||
#endif // MINDSPORE_CORE_API_IR_FUNC_GRAPH_H_
|
||||
|
|
|
@ -743,5 +743,8 @@ size_t NewFgSeenGeneration() {
|
|||
// Implement TopoSort api.
|
||||
std::vector<AnfNodePtr> api::FuncGraph::TopoSort(const AnfNodePtr &node) { return mindspore::TopoSort(node); }
|
||||
|
||||
// Create an api::FuncGraph instance.
|
||||
api::FuncGraphPtr api::FuncGraph::Create() { return std::make_shared<mindspore::FuncGraph>(); }
|
||||
|
||||
const PrimitivePtr FuncGraphTransform::func_graph_prim_ = std::make_shared<Primitive>("FuncGraph");
|
||||
} // namespace mindspore
|
||||
|
|
Loading…
Reference in New Issue