Skip to content

Commit

Permalink
fix convert weight failed. (#45346)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiweibo committed Aug 24, 2022
1 parent fac8a26 commit 3d514e4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ void SaveMixedModel(
if (var->IsType<framework::LoDTensor>() ||
var->IsType<framework::Tensor>()) {
auto* t = var->GetMutable<framework::LoDTensor>();
if (t->dtype() != phi::DataType::FLOAT32) continue;

framework::Tensor mixed_tensor;
mixed_tensor.Resize(t->dims());
auto* data = t->mutable_data<float>(platform::CPUPlace());
Expand Down

0 comments on commit 3d514e4

Please sign in to comment.