Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code conflict of empty dev_api #39430

Merged
merged 3 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions paddle/pten/kernels/sparse/gpu/sparse_utils_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,7 @@ void SparseCooToDenseKernel(const Context& dev_ctx,

auto sparse_offset_meta = pten::DenseTensorMeta(
DataType::INT64, {sparse_dim}, pten::DataLayout::NCHW);
DenseTensor d_sparse_offsets =
pten::Empty<T, Context>(dev_ctx, std::move(sparse_offset_meta));
DenseTensor d_sparse_offsets = Empty(dev_ctx, std::move(sparse_offset_meta));

#ifdef PADDLE_WITH_HIP
PADDLE_ENFORCE_GPU_SUCCESS(
Expand Down
4 changes: 2 additions & 2 deletions paddle/pten/kernels/sparse/sparse_utils_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void SparseCooToDenseKernel(const Context& dev_ctx,
template <typename T, typename Context>
DenseTensor SparseCooToDense(const Context& dev_ctx, const SparseCooTensor& x) {
DenseTensorMeta meta(x.dtype(), x.dims(), x.layout());
DenseTensor dense = pten::Empty<T, Context>(dev_ctx, std::move(meta));
DenseTensor dense = pten::Empty(dev_ctx, std::move(meta));
SparseCooToDenseKernel<T, Context>(dev_ctx, x, &dense);
return dense;
}
Expand All @@ -145,7 +145,7 @@ void SparseCsrToDenseKernel(const Context& dev_ctx,
template <typename T, typename Context>
DenseTensor SparseCsrToDense(const Context& dev_ctx, const SparseCsrTensor& x) {
DenseTensorMeta meta(x.dtype(), x.dims(), x.layout());
DenseTensor dense = pten::Empty<T, Context>(dev_ctx, std::move(meta));
DenseTensor dense = pten::Empty(dev_ctx, std::move(meta));
SparseCsrToDenseKernel<T, Context>(dev_ctx, x, &dense);
return dense;
}
Expand Down