Skip to content

Commit 565b19b

Browse files
committed
fix set data type bug
test=develop
1 parent 8364688 commit 565b19b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

paddle/fluid/imperative/layer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class VarBase {
195195
// data type. e.g.. FP32
196196
inline void SetDataType(framework::proto::VarType::Type type) {
197197
auto tensor = var_->GetMutable<framework::LoDTensor>();
198-
tensor->mutable_data(place_, type);
198+
tensor->mutable_data(tensor->place(), type);
199199
}
200200
inline framework::proto::VarType::Type DataType() const {
201201
auto tensor = var_->Get<framework::LoDTensor>();

0 commit comments

Comments
 (0)