diff --git a/paddle/cinn/hlir/framework/pir/op_lowering_impl.cc b/paddle/cinn/hlir/framework/pir/op_lowering_impl.cc index a7db7bcd031049..f231f440798959 100644 --- a/paddle/cinn/hlir/framework/pir/op_lowering_impl.cc +++ b/paddle/cinn/hlir/framework/pir/op_lowering_impl.cc @@ -1119,10 +1119,15 @@ ir::Tensor OpLowererImpl::GetTensor(const OpLoweringGroupPtr& group, } auto tensor = lang::CreatePlaceHolder( sym_shape, CompatibleInfo::ConvertIRType(dtype), input_id); - const auto& tensor_value = details::GetTensorValueFromShapeOrData( - group->GetShapeOrDataExprs(value)); - if (tensor_value.has_value()) { - tensor->set_value(*tensor_value); + auto IsIntType = [](const ::pir::Type& t) { + return t.isa<::pir::Int32Type>() || t.isa<::pir::Int64Type>(); + }; + if (IsIntType(dtype) && group->HasShapeOrDataExprs(value)) { + const auto& tensor_value = details::GetTensorValueFromShapeOrData( + group->GetShapeOrDataExprs(value)); + if (tensor_value.has_value()) { + tensor->set_value(*tensor_value); + } } return tensor; } else {