From 9409ff6bfd6f2665c5d5444ac88d3ced02d98113 Mon Sep 17 00:00:00 2001 From: Baibaifan <39549453+Baibaifan@users.noreply.github.com> Date: Fri, 24 Dec 2021 14:35:59 +0800 Subject: [PATCH] fix share buffer to (#38407) --- paddle/fluid/pybind/imperative.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/fluid/pybind/imperative.cc b/paddle/fluid/pybind/imperative.cc index 2190dafbff8..900b49ea7e6 100644 --- a/paddle/fluid/pybind/imperative.cc +++ b/paddle/fluid/pybind/imperative.cc @@ -1983,6 +1983,7 @@ void BindImperative(py::module *m_ptr) { platform::errors::InvalidArgument( "Tensor %s has not been initialized!", self->Name())); dst_->ShareBufferWith(*src); + dst_->ShareDataTypeWith(*src); }) .def("_is_shared_buffer_with", [](const std::shared_ptr &self, -- GitLab