# tensorflow::ops::SparseSegmentMeanWithNumSegments Class Reference

# tensorflow::
ops::
SparseSegmentMeanWithNumSegments

`
#include <math_ops.h>
`


Computes the mean along sparse segments of a tensor.

## Summary


Like
`
https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/sparse-segment-mean#classtensorflow_1_1ops_1_1_sparse_segment_mean
`
, but allows missing ids in
`
segment_ids
`
. If an id is missing, the
`
output
`
tensor at that position will be zeroed.


Read
[the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation)
for an explanation of segments.


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- indices: A 1-D tensor. Has same rank as `
  segment_ids
  ` .
- segment_ids: A 1-D tensor. Values should be sorted and can be repeated.
- num_segments: Should equal the number of distinct segment IDs.

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` : Has same shape as data, except for dimension 0 which has size `
  num_segments
  ` .

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/sparse-segment-mean-with-num-segments#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1acc14eb336c9bb422d63a332e5ff475aa (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input data, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input indices, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input segment_ids, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input num_segments) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/sparse-segment-mean-with-num-segments#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1a1750008c63c66918b6adeac3d952ecef ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/sparse-segment-mean-with-num-segments#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1a7a024ed618e930ac1bea2d738bd0f394 ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/sparse-segment-mean-with-num-segments#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1ab959360a1d82011d10097010d5274941 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/sparse-segment-mean-with-num-segments#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1a0856c9bfce8692ac6cfaf403591e8d4e () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/sparse-segment-mean-with-num-segments#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1a298a1bf3fbf9b34d2c306955c3090ff8 () const ` | ` ` |

## Public attributes

### operation

```
Operation operation
```

### output

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

## Public functions

### SparseSegmentMeanWithNumSegments

```
 SparseSegmentMeanWithNumSegments(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input data,
  ::tensorflow::Input indices,
  ::tensorflow::Input segment_ids,
  ::tensorflow::Input num_segments
)
```

### node

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

### operator::tensorflow::Input

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

### operator::tensorflow::Output

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