Skip to content

Commit

Permalink
Fix code conflict of empty dev_api (#39430)
Browse files Browse the repository at this point in the history
* fix code conflict

* clear cache

* just try
  • Loading branch information
zyfncg authored Feb 10, 2022
1 parent 9d4d0c3 commit 2a5d858
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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

0 comments on commit 2a5d858

Please sign in to comment.