diff --git a/paddle/framework/net.h b/paddle/framework/net.h index e60356dc1728488dab8c218d8ebe585ed5d28ad2..2025bfa4b236602ae580ef6bc75c80f837e22923 100644 --- a/paddle/framework/net.h +++ b/paddle/framework/net.h @@ -91,6 +91,8 @@ class Net { * @brief Create a network. */ static std::unique_ptr Create(const NetDesc &def = NetDesc()); + + virtual ~Net() {} }; /** @@ -140,6 +142,8 @@ class PlainNet : public Net { */ virtual void AddBackwardOps() override; + virtual ~PlainNet() override {} + protected: /** * @brief Build the network.