未验证 提交 3d514e48 编写于 作者: W Wilber 提交者: GitHub

fix convert weight failed. (#45346)

上级 fac8a260
......@@ -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());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册