提交 5f558042 编写于 作者: M Megvii Engine Team

fix(imperative/ops): use tblgen to generate FastpathCopy

GitOrigin-RevId: b02157dacb8c08e8ee06b47cd442229832f15c94
上级 bfc4e7a9
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "megbrain/common.h" #include "megbrain/common.h"
#include "megbrain/imperative/ops/utility.h" #include "megbrain/imperative/ops/utility.h"
#include "megbrain/imperative/ops/backward_graph.h" #include "megbrain/imperative/ops/backward_graph.h"
#include "megbrain/imperative/ops/autogen.h"
#include "megbrain/imperative/profiler.h" #include "megbrain/imperative/profiler.h"
#include "megbrain/opr/io.h" #include "megbrain/opr/io.h"
......
...@@ -31,8 +31,6 @@ OP_TRAIT_REG(FastpathCopy,FastpathCopy) ...@@ -31,8 +31,6 @@ OP_TRAIT_REG(FastpathCopy,FastpathCopy)
.fallback(); .fallback();
}} // fastpathcopy }} // fastpathcopy
MGB_DYN_TYPE_OBJ_FINAL_IMPL(FastpathCopy);
namespace { namespace identity { namespace { namespace identity {
auto apply_on_var_node( auto apply_on_var_node(
const OpDef& def, const OpDef& def,
......
...@@ -35,18 +35,4 @@ struct GenericPyOp final : OpDefImplBase<GenericPyOp> { ...@@ -35,18 +35,4 @@ struct GenericPyOp final : OpDefImplBase<GenericPyOp> {
MGB_DYN_TYPE_OBJ_FINAL_DECL; MGB_DYN_TYPE_OBJ_FINAL_DECL;
}; };
struct FastpathCopy final : OpDefImplBase<FastpathCopy> {
FastpathCopy() = default;
size_t hash() const override {
return mgb::hash(this->dyn_typeinfo());
}
bool is_same_st(const Hashable& rhs) const override {
return this->dyn_typeinfo() == rhs.dyn_typeinfo();
}
MGB_DYN_TYPE_OBJ_FINAL_DECL;
};
} // namespace mgb::imperative } // namespace mgb::imperative
...@@ -375,4 +375,6 @@ def CvtColor: MgbHashableOp<"CvtColor", [CvtColorParam]>; ...@@ -375,4 +375,6 @@ def CvtColor: MgbHashableOp<"CvtColor", [CvtColorParam]>;
def CheckHasInf: MgbHashableOp<"CheckHasInf", [EmptyParam]>; def CheckHasInf: MgbHashableOp<"CheckHasInf", [EmptyParam]>;
def FastpathCopy: MgbHashableOp<"FastpathCopy">;
#endif // MGB_OPS #endif // MGB_OPS
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册