未验证 提交 2a5d858c 编写于 作者: Z zyfncg 提交者: GitHub

Fix code conflict of empty dev_api (#39430)

* fix code conflict

* clear cache

* just try
上级 9d4d0c3b
...@@ -514,8 +514,7 @@ void SparseCooToDenseKernel(const Context& dev_ctx, ...@@ -514,8 +514,7 @@ void SparseCooToDenseKernel(const Context& dev_ctx,
auto sparse_offset_meta = pten::DenseTensorMeta( auto sparse_offset_meta = pten::DenseTensorMeta(
DataType::INT64, {sparse_dim}, pten::DataLayout::NCHW); DataType::INT64, {sparse_dim}, pten::DataLayout::NCHW);
DenseTensor d_sparse_offsets = DenseTensor d_sparse_offsets = Empty(dev_ctx, std::move(sparse_offset_meta));
pten::Empty<T, Context>(dev_ctx, std::move(sparse_offset_meta));
#ifdef PADDLE_WITH_HIP #ifdef PADDLE_WITH_HIP
PADDLE_ENFORCE_GPU_SUCCESS( PADDLE_ENFORCE_GPU_SUCCESS(
......
...@@ -126,7 +126,7 @@ void SparseCooToDenseKernel(const Context& dev_ctx, ...@@ -126,7 +126,7 @@ void SparseCooToDenseKernel(const Context& dev_ctx,
template <typename T, typename Context> template <typename T, typename Context>
DenseTensor SparseCooToDense(const Context& dev_ctx, const SparseCooTensor& x) { DenseTensor SparseCooToDense(const Context& dev_ctx, const SparseCooTensor& x) {
DenseTensorMeta meta(x.dtype(), x.dims(), x.layout()); 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); SparseCooToDenseKernel<T, Context>(dev_ctx, x, &dense);
return dense; return dense;
} }
...@@ -145,7 +145,7 @@ void SparseCsrToDenseKernel(const Context& dev_ctx, ...@@ -145,7 +145,7 @@ void SparseCsrToDenseKernel(const Context& dev_ctx,
template <typename T, typename Context> template <typename T, typename Context>
DenseTensor SparseCsrToDense(const Context& dev_ctx, const SparseCsrTensor& x) { DenseTensor SparseCsrToDense(const Context& dev_ctx, const SparseCsrTensor& x) {
DenseTensorMeta meta(x.dtype(), x.dims(), x.layout()); 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); SparseCsrToDenseKernel<T, Context>(dev_ctx, x, &dense);
return dense; return dense;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册