Skip to content

Commit aa8c699

Browse files
committed
Fix
1 parent 46278ec commit aa8c699

File tree

4 files changed

+4
-109
lines changed

4 files changed

+4
-109
lines changed

paddle/fluid/framework/variable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ class Variable {
4949
if (!holder_) {
5050
holder_.reset(new PlaceholderImpl<T>());
5151
} else {
52-
// If holder_ is RawTensor, return it. Used for load_combine.
52+
// If holder_ is RawTensor, call GetMutable again. Used for load_combine.
5353
if (holder_->Type() == VarTypeTrait<RawTensor>::kId &&
5454
holder_->Type() != VarTypeTrait<T>::kId) {
55-
return static_cast<T*>(holder_->Ptr());
55+
return static_cast<RawTensor*>(holder_->Ptr())->GetMutable<T>();
5656
}
5757
PADDLE_ENFORCE_EQ(
5858
holder_->Type(),

paddle/phi/core/framework/raw_tensor.h

Lines changed: 0 additions & 105 deletions
This file was deleted.

paddle/phi/core/utils/type_info.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ limitations under the License. */
1919
#include "paddle/phi/backends/gpu/gpu_context.h"
2020
#include "paddle/phi/backends/xpu/xpu_context.h"
2121
#include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h"
22-
#include "paddle/phi/core/framework/raw_tensor.h"
22+
#include "paddle/phi/core/raw_tensor.h"
2323
#include "paddle/phi/core/selected_rows.h"
2424
#include "paddle/phi/core/sparse_coo_tensor.h"
2525
#include "paddle/phi/core/sparse_csr_tensor.h"

paddle/phi/kernels/impl/load_combine_kernel_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
#include "paddle/phi/core/framework/convert_utils.h"
2323
#include "paddle/phi/core/framework/data_type_transform.h"
2424
#include "paddle/phi/core/framework/lod_tensor_serialize.h"
25-
#include "paddle/phi/core/framework/raw_tensor.h"
2625
#include "paddle/phi/core/framework/var_type_helper.h"
2726
#include "paddle/phi/core/kernel_registry.h"
2827
#include "paddle/phi/core/platform/device_context.h"
28+
#include "paddle/phi/core/raw_tensor.h"
2929
#include "paddle/phi/core/tensor_utils.h"
3030
#include "paddle/phi/core/vocab/string_array.h"
3131

0 commit comments

Comments
 (0)