# tensorflow::ops::SparseReduceMax Class Reference

# tensorflow::
ops::
SparseReduceMax

`
#include <sparse_ops.h>
`


Computes the max of elements across dimensions of a SparseTensor.

## Summary


This Op takes a SparseTensor and is the sparse counterpart to
`
tf.reduce_max()
`
. In particular, this Op also returns a dense
`
https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor
`
instead of a sparse one.


Reduces
`
sp_input
`
along the dimensions given in
`
reduction_axes
`
. Unless
`
keep_dims
`
is true, the rank of the tensor is reduced by 1 for each entry in
`
reduction_axes
`
. If
`
keep_dims
`
is true, the reduced dimensions are retained with length 1.


If
`
reduction_axes
`
has no entries, all dimensions are reduced, and a tensor with a single element is returned. Additionally, the axes can be negative, which are interpreted according to the indexing rules in Python.


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- input_indices: 2-D. `
  N x R
  ` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
- input_values: 1-D. `
  N
  ` non-empty values corresponding to `
  input_indices
  ` .
- input_shape: 1-D. Shape of the input SparseTensor.
- reduction_axes: 1-D. Length- `
  K
  ` vector containing the reduction axes.

<br />


Optional attributes (see
`
https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/sparse-reduce-max/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs
`
):

- keep_dims: If true, retain reduced dimensions with length 1.

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` : `
  R-K
  ` -D. The reduced [Tensor](https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) .

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max_1aeae496cfc74e42b24882c7d5148b23e0 (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 input_indices, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input input_values, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input input_shape, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input reduction_axes) ` ||
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a451a0e2215cd3d4e69813f5405ae454f (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 input_indices, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input input_values, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input input_shape, :: https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input reduction_axes, const https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/sparse-reduce-max/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs & attrs) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a90126f27d38e5eddd6614a6f5330b139 ` | ` 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-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max_1ada3c0765be81f44a13f068c10a43cb34 ` | ` :: 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-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a886a875c7b1cfc9b2f69ce45239582c3 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a99bf4a11aed55ac04ed9aadfe5f3c8f9 () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a6687bcf1dca9bdb8019f8fcf46c00a17 () const ` | ` ` |

| ### Public static functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max_1adc6b4f1a804b4ca85bc40b2a677288ae (bool x) ` | ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/sparse-reduce-max/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs ` |

| ### Structs ||
|---|---|
| [tensorflow:: ops:: SparseReduceMax:: Attrs](https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/sparse-reduce-max/attrs) | Optional attribute setters for [SparseReduceMax](https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max) . |

## Public attributes

### operation

```
Operation operation
```

### output

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

## Public functions

### SparseReduceMax

```
 SparseReduceMax(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input_indices,
  ::tensorflow::Input input_values,
  ::tensorflow::Input input_shape,
  ::tensorflow::Input reduction_axes
)
```

### SparseReduceMax

```
 SparseReduceMax(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input_indices,
  ::tensorflow::Input input_values,
  ::tensorflow::Input input_shape,
  ::tensorflow::Input reduction_axes,
  const SparseReduceMax::Attrs & attrs
)
```

### node

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

### operator::tensorflow::Input

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

### operator::tensorflow::Output

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

## Public static functions

### KeepDims

```
Attrs KeepDims(
  bool x
)
```