Skip to content

Commit

Permalink
Merge pull request #15 from JiabinYang/alloc_dealloc
Browse files Browse the repository at this point in the history
Call EagerTensor's construction and destructor functions
  • Loading branch information
JiabinYang committed Nov 2, 2021
2 parents 3f5a7d3 + 91c4b67 commit 0483d22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion paddle/fluid/pybind/eager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ PyObject* eagertensor_new(PyTypeObject* type, PyObject* args,
}

static void eagertensor_dealloc(EagerTensorObject* self) {
// TODO(wanghuancoder): Call destructor here.
self->eagertensor.~EagerTensor();
Py_TYPE(self)->tp_free(reinterpret_cast<PyObject*>(self));
}

Expand Down
2 changes: 2 additions & 0 deletions paddle/fluid/pybind/eager_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ PyObject* ToPyObject(const egr::EagerTensor& value) {
PyObject* obj = pEagerTensorType->tp_alloc(pEagerTensorType, 0);
if (obj) {
auto v = reinterpret_cast<EagerTensorObject*>(obj);
new (&(v->eagertensor)) egr::EagerTensor();
v->eagertensor = value;
} else {
PADDLE_THROW(platform::errors::Fatal(
Expand Down Expand Up @@ -222,6 +223,7 @@ PyObject* ToPyObject(const std::vector<egr::EagerTensor>& value) {
PyObject* obj = pEagerTensorType->tp_alloc(pEagerTensorType, 0);
if (obj) {
auto v = reinterpret_cast<EagerTensorObject*>(obj);
new (&(v->eagertensor)) egr::EagerTensor();
v->eagertensor = value[i];
} else {
PADDLE_THROW(platform::errors::Fatal(
Expand Down

1 comment on commit 0483d22

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 0483d22 Nov 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #15 Commit ID: 0483d22 contains failed CI.

🔹 Failed: PR-CI-musl

Unknown Failed
2021-11-02 11:04:29 Auto-merging paddle/fluid/framework/pten_utils.h
2021-11-02 11:04:29 CONFLICT (add/add): Merge conflict in paddle/fluid/framework/pten_utils.h
2021-11-02 11:04:29 Auto-merging paddle/fluid/framework/pten_utils.cc
2021-11-02 11:04:29 CONFLICT (add/add): Merge conflict in paddle/fluid/framework/pten_utils.cc
2021-11-02 11:04:29 Removing paddle/fluid/framework/paddle2cinn/cinn_runner_test.cc
2021-11-02 11:04:29 Removing paddle/fluid/framework/paddle2cinn/cinn_runner.h
2021-11-02 11:04:29 Removing paddle/fluid/framework/paddle2cinn/cinn_runner.cc
2021-11-02 11:04:29 Removing paddle/fluid/framework/paddle2cinn/cinn_compiled_object_test.cc
2021-11-02 11:04:29 Removing paddle/fluid/framework/paddle2cinn/cinn_compiled_object.h
2021-11-02 11:04:29 Removing paddle/fluid/framework/paddle2cinn/cinn_compiled_object.cc
2021-11-02 11:04:29 Auto-merging paddle/fluid/framework/operator.h
2021-11-02 11:04:29 CONFLICT (content): Merge conflict in paddle/fluid/framework/operator.h
2021-11-02 11:04:29 Auto-merging paddle/fluid/framework/operator.cc
2021-11-02 11:04:29 CONFLICT (content): Merge conflict in paddle/fluid/framework/operator.cc
2021-11-02 11:04:29 Auto-merging paddle/fluid/framework/details/nan_inf_utils.h
2021-11-02 11:04:29 Auto-merging paddle/fluid/framework/details/CMakeLists.txt
2021-11-02 11:04:29 Auto-merging paddle/fluid/framework/CMakeLists.txt
2021-11-02 11:04:29 CONFLICT (content): Merge conflict in paddle/fluid/framework/CMakeLists.txt
2021-11-02 11:04:29 Automatic merge failed; fix conflicts and then commit the result.

🔹 Failed: PR-CI-APPROVAL

Unknown Failed
2021-11-02 11:04:53 自动合并 paddle/fluid/imperative/prepared_operator.cc
2021-11-02 11:04:53 冲突(内容):合并冲突于 paddle/fluid/imperative/prepared_operator.cc
2021-11-02 11:04:53 自动合并 paddle/fluid/framework/type_defs.h
2021-11-02 11:04:53 冲突(内容):合并冲突于 paddle/fluid/framework/type_defs.h
2021-11-02 11:04:53 冲突(add/add):合并冲突于 paddle/fluid/framework/pten_utils_test.cc
2021-11-02 11:04:53 自动合并 paddle/fluid/framework/pten_utils_test.cc
2021-11-02 11:04:53 冲突(add/add):合并冲突于 paddle/fluid/framework/pten_utils.h
2021-11-02 11:04:53 自动合并 paddle/fluid/framework/pten_utils.h
2021-11-02 11:04:53 冲突(add/add):合并冲突于 paddle/fluid/framework/pten_utils.cc
2021-11-02 11:04:53 自动合并 paddle/fluid/framework/pten_utils.cc
2021-11-02 11:04:53 自动合并 paddle/fluid/framework/operator.h
2021-11-02 11:04:53 冲突(内容):合并冲突于 paddle/fluid/framework/operator.h
2021-11-02 11:04:53 自动合并 paddle/fluid/framework/operator.cc
2021-11-02 11:04:53 冲突(内容):合并冲突于 paddle/fluid/framework/operator.cc
2021-11-02 11:04:53 自动合并 paddle/fluid/framework/details/nan_inf_utils.h
2021-11-02 11:04:53 自动合并 paddle/fluid/framework/details/CMakeLists.txt
2021-11-02 11:04:53 自动合并 paddle/fluid/framework/CMakeLists.txt
2021-11-02 11:04:53 冲突(内容):合并冲突于 paddle/fluid/framework/CMakeLists.txt
2021-11-02 11:04:53 自动合并失败,修正冲突然后提交修正的结果。

🔹 Failed: PR-CI-Inference

failed in build-docker-image job
failed in build-docker-image job

🔹 Failed: PR-CI-iScan-Python

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-Coverage

failed in build-docker-image job
failed in build-docker-image job

🔹 Failed: PR-CI-Windows

Unknown Failed
2021-11-02 11:05:44 Auto-merging paddle/fluid/framework/pten_utils.h
2021-11-02 11:05:44 CONFLICT (add/add): Merge conflict in paddle/fluid/framework/pten_utils.cc
2021-11-02 11:05:44 Auto-merging paddle/fluid/framework/pten_utils.cc
2021-11-02 11:05:44 Removing paddle/fluid/framework/paddle2cinn/cinn_runner_test.cc
2021-11-02 11:05:44 Removing paddle/fluid/framework/paddle2cinn/cinn_runner.h
2021-11-02 11:05:44 Removing paddle/fluid/framework/paddle2cinn/cinn_runner.cc
2021-11-02 11:05:44 Removing paddle/fluid/framework/paddle2cinn/cinn_compiled_object_test.cc
2021-11-02 11:05:44 Removing paddle/fluid/framework/paddle2cinn/cinn_compiled_object.h
2021-11-02 11:05:44 Removing paddle/fluid/framework/paddle2cinn/cinn_compiled_object.cc
2021-11-02 11:05:44 Auto-merging paddle/fluid/framework/operator.h
2021-11-02 11:05:44 CONFLICT (content): Merge conflict in paddle/fluid/framework/operator.h
2021-11-02 11:05:44 Auto-merging paddle/fluid/framework/operator.cc
2021-11-02 11:05:44 CONFLICT (content): Merge conflict in paddle/fluid/framework/operator.cc
2021-11-02 11:05:44 Auto-merging paddle/fluid/framework/details/nan_inf_utils.h
2021-11-02 11:05:44 Auto-merging paddle/fluid/framework/details/CMakeLists.txt
2021-11-02 11:05:44 Auto-merging paddle/fluid/framework/CMakeLists.txt
2021-11-02 11:05:44 CONFLICT (content): Merge conflict in paddle/fluid/framework/CMakeLists.txt
2021-11-02 11:05:44 Automatic merge failed; fix conflicts and then commit the result.
2021-11-02 11:05:44 C:\Users\Administrator\Downloads\workspace\ca78e441-bdc3-4a3a-a76b-af122681f243\Paddle>if 1 NEQ 0 exit /b 1

Please sign in to comment.