diff --git a/imperative/python/src/tensor.cpp b/imperative/python/src/tensor.cpp index ee28d8fd2b1758210192277f0133f998b047eb4b..73d3c2697342c646356d1655f08fd852f312bd37 100644 --- a/imperative/python/src/tensor.cpp +++ b/imperative/python/src/tensor.cpp @@ -13,6 +13,7 @@ #include "megbrain/common.h" #include "megbrain/imperative/ops/utility.h" #include "megbrain/imperative/ops/backward_graph.h" +#include "megbrain/imperative/ops/autogen.h" #include "megbrain/imperative/profiler.h" #include "megbrain/opr/io.h" diff --git a/imperative/src/impl/ops/utility.cpp b/imperative/src/impl/ops/utility.cpp index d4e8deefa93f53a9db5a8def19f489b5b42139ca..14654134bc96f88dd9be6bc22316f132e9e96c36 100644 --- a/imperative/src/impl/ops/utility.cpp +++ b/imperative/src/impl/ops/utility.cpp @@ -31,8 +31,6 @@ OP_TRAIT_REG(FastpathCopy,FastpathCopy) .fallback(); }} // fastpathcopy -MGB_DYN_TYPE_OBJ_FINAL_IMPL(FastpathCopy); - namespace { namespace identity { auto apply_on_var_node( const OpDef& def, diff --git a/imperative/src/include/megbrain/imperative/ops/utility.h b/imperative/src/include/megbrain/imperative/ops/utility.h index ab58283c6b589311231535f67c903f1a20118aab..dc327d08d8e87f55968df59bf1a71bb621cd9c2f 100644 --- a/imperative/src/include/megbrain/imperative/ops/utility.h +++ b/imperative/src/include/megbrain/imperative/ops/utility.h @@ -35,18 +35,4 @@ struct GenericPyOp final : OpDefImplBase { MGB_DYN_TYPE_OBJ_FINAL_DECL; }; -struct FastpathCopy final : OpDefImplBase { - 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 diff --git a/src/core/include/megbrain/ir/ops.td b/src/core/include/megbrain/ir/ops.td index a74af609a61a2eec6e48de30d05ed09ad80396af..7bb892e2eabe8fe0ac745b298555a061528a97d4 100644 --- a/src/core/include/megbrain/ir/ops.td +++ b/src/core/include/megbrain/ir/ops.td @@ -375,4 +375,6 @@ def CvtColor: MgbHashableOp<"CvtColor", [CvtColorParam]>; def CheckHasInf: MgbHashableOp<"CheckHasInf", [EmptyParam]>; +def FastpathCopy: MgbHashableOp<"FastpathCopy">; + #endif // MGB_OPS