diff --git a/paddle/fluid/eager/pylayer/py_layer_node.h b/paddle/fluid/eager/pylayer/py_layer_node.h index 8c93eb944f7e6979adeecdb91f8a45fc0ff0fe21..eb8d1bc9c57a9ec952045804da32b2a886455a85 100644 --- a/paddle/fluid/eager/pylayer/py_layer_node.h +++ b/paddle/fluid/eager/pylayer/py_layer_node.h @@ -34,6 +34,13 @@ class GradNodePyLayer : public GradNodeBase { Py_INCREF(ctx_); } + GradNodePyLayer(const GradNodePyLayer& other) : GradNodeBase(other) { + this->ctx_ = other.ctx_; + Py_INCREF(this->ctx_); + this->forward_outputs_meta_ = other.forward_outputs_meta_; + this->forward_outputs_place_ = other.forward_outputs_place_; + } + ~GradNodePyLayer() override; virtual paddle::small_vector,