# tensorflow::ops::SparseDenseCwiseAdd Class Reference

# tensorflow::
ops::
SparseDenseCwiseAdd

`
#include <sparse_ops.h>
`


Adds up a SparseTensor and a dense
[Tensor](https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor)
, using these special rules:

## Summary


(1) Broadcasts the dense side to have the same shape as the sparse side, if eligible; (2) Then, only the dense values pointed to by the indices of the SparseTensor participate in the cwise addition.


By these rules, the result is a logical SparseTensor with exactly the same indices and shape, but possibly with different non-zero values. The output of this Op is the resultant non-zero values.


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- sp_indices: 2-D. `
  N x R
  ` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
- sp_values: 1-D. `
  N
  ` non-empty values corresponding to `
  sp_indices
  ` .
- sp_shape: 1-D. Shape of the input SparseTensor.
- dense: `
  R
  ` -D. The dense [Tensor](https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) operand.

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` : 1-D. The `
  N
  ` values that are operated on.

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-dense-cwise-add#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1a40c54ec3d21552370675a287e1998c0f (const :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input sp_indices, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input sp_values, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input sp_shape, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input dense) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-dense-cwise-add#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1a72eb8f04e1ba3079957c50afaaa13e79 ` | ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-dense-cwise-add#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1afe9875882370618c9e8b76e5d1dccb26 ` | ` :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-dense-cwise-add#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1a4e49f5451389b499b3f51dfeb39146b6 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-dense-cwise-add#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1ac05df51f21a0dc708e8ab33c853e5d6c () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-dense-cwise-add#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1af0582cc0d8c6d71b9de9e50358f27392 () const ` | ` ` |

## Public attributes

### operation

```
Operation operation
```

### output

```
::tensorflow::Output output
```

## Public functions

### SparseDenseCwiseAdd

```
 SparseDenseCwiseAdd(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input sp_indices,
  ::tensorflow::Input sp_values,
  ::tensorflow::Input sp_shape,
  ::tensorflow::Input dense
)
```

### node

```
::tensorflow::Node * node() const 
```

### operator::tensorflow::Input

```
 operator::tensorflow::Input() const 
```

### operator::tensorflow::Output

```
 operator::tensorflow::Output() const 
```