Skip to content

Commit

Permalink
fix no delete bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghuancoder committed Jul 27, 2023
1 parent 2d85bc9 commit e76977a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions paddle/phi/api/lib/api_gen_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ void TransStride(const Context& dev_ctx,
to->offset(),
to);
}));
delete from;
}
}

Expand All @@ -357,6 +358,7 @@ void TransStride(const Context& dev_ctx,
to[i]->offset(),
to[i]);
}));
delete from[i];
}
}
}
Expand All @@ -376,6 +378,7 @@ void TransStride(phi::DeviceContext* dev_ctx,
to->offset(),
to);
}));
delete from;
return;
}
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
Expand All @@ -390,6 +393,7 @@ void TransStride(phi::DeviceContext* dev_ctx,
to->offset(),
to);
}));
delete from;
return;
}
#endif
Expand All @@ -405,6 +409,7 @@ void TransStride(phi::DeviceContext* dev_ctx,
to->offset(),
to);
}));
delete from;
return;
}
#endif
Expand All @@ -427,6 +432,7 @@ void TransStride(phi::DeviceContext* dev_ctx,
to[i]->offset(),
to[i]);
}));
delete from[i];
continue;
}
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
Expand All @@ -441,6 +447,7 @@ void TransStride(phi::DeviceContext* dev_ctx,
to[i]->offset(),
to[i]);
}));
delete from[i];
continue;
}
#endif
Expand All @@ -456,6 +463,7 @@ void TransStride(phi::DeviceContext* dev_ctx,
to[i]->offset(),
to[i]);
}));
delete from[i];
continue;
}
#endif
Expand Down

0 comments on commit e76977a

Please sign in to comment.