Skip to content

Commit

Permalink
add sparse elementwise v0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gsq7474741 committed Apr 17, 2022
1 parent 8295c6c commit c0a1715
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions paddle/phi/kernels/sparse/cpu/sparse_elementwise_kernel.cc
Expand Up @@ -30,13 +30,7 @@ namespace sparse {
const SparseCsrTensor& x, \
const SparseCsrTensor& y, \
SparseCsrTensor* out) { \
PADDLE_ENFORCE_EQ( \
x.dims(), \
y.dims(), \
"ValueError: Mismatched shape. Expected x.dims = y.dims, " \
"but got x.dims = %s, y.dims = %s", \
x.dims().to_str(), \
y.dims().to_str()); \
PADDLE_ENFORCE_EQ(x.dims(), y.dims()); \
const auto& n_row = x.dims()[0]; \
const auto& n_col = x.dims()[1]; \
const auto& x_nnz = x.non_zero_elements().numel(); \
Expand Down Expand Up @@ -146,6 +140,7 @@ void ElementWiseDivideCsrKernel(const Context& dev_ctx,
const SparseCsrTensor& x,
const SparseCsrTensor& y,
SparseCsrTensor* out) {
PADDLE_ENFORCE_EQ(x.dims(), y.dims());
const auto& n_row = x.dims()[0];
const auto& n_col = x.dims()[1];
const auto& x_nnz = x.non_zero_elements().numel();
Expand Down

0 comments on commit c0a1715

Please sign in to comment.