check op_version_registry in CI test, test=develop (#28402)

TCChenlong-patch-1
石晓伟 5 years ago committed by GitHub
parent 2500dca878
commit c41fd033e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -92,7 +92,7 @@ enum class OpUpdateType {
class OpUpdateBase {
public:
virtual const OpUpdateInfo* info() const = 0;
virtual const OpUpdateInfo& info() const = 0;
virtual OpUpdateType type() const = 0;
virtual ~OpUpdateBase() = default;
};
@ -101,7 +101,7 @@ template <typename InfoType, OpUpdateType type__>
class OpUpdate : public OpUpdateBase {
public:
explicit OpUpdate(const InfoType& info) : info_{info}, type_{type__} {}
const OpUpdateInfo* info() const override { return &info_; }
const InfoType& info() const override { return info_; }
OpUpdateType type() const override { return type_; }
private:
@ -169,7 +169,6 @@ class OpVersion {
class OpVersionRegistrar {
public:
OpVersionRegistrar() = default;
static OpVersionRegistrar& GetInstance() {
static OpVersionRegistrar instance;
return instance;
@ -185,6 +184,8 @@ class OpVersionRegistrar {
private:
std::unordered_map<std::string, OpVersion> op_version_map_;
OpVersionRegistrar() = default;
OpVersionRegistrar& operator=(const OpVersionRegistrar&) = delete;
};
inline const std::unordered_map<std::string, OpVersion>& get_op_version_map() {

@ -130,7 +130,7 @@ REGISTER_OP_VERSION(distribute_fpn_proposals)
Upgrade distribute_fpn_proposals add a new input
[RoisNum] and add a new output [MultiLevelRoIsNum].)ROC",
paddle::framework::compatible::OpVersionDesc()
.NewInput("RoIsNum", "The number of RoIs in each image.")
.NewInput("RoisNum", "The number of RoIs in each image.")
.NewOutput("MultiLevelRoisNum",
"The RoIs' number of each image on multiple "
"levels. The number on each level has the shape of (B),"

@ -95,8 +95,7 @@ void BindOpUpdateType(py::module *m) {
void BindOpUpdateBase(py::module *m) {
py::class_<OpUpdateBase>(*m, "OpUpdateBase")
.def("info", [](const OpUpdateBase &obj) { return obj.info(); },
py::return_value_policy::reference)
.def("info", &OpUpdateBase::info, py::return_value_policy::reference)
.def("type", &OpUpdateBase::type);
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save