未验证 提交 52009d19 编写于 作者: N niuliling123 提交者: GitHub

Update for SetOutDataLayout when VarType is EagerVariable (#46515)

上级 681d6b14
......@@ -25,7 +25,7 @@ namespace imperative {
template <typename VarType>
void SetOutDataLayout(std::shared_ptr<VarType> var,
const paddle::experimental::DataLayout layout) {
if (var != nullptr) {
if (var != nullptr && var->Var().IsInitialized()) {
paddle::imperative::SetDataLayout(var, layout);
// set out_tensor's layout
if (var->MutableVar()->IsInitialized()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册