# tensorflow::ops::MaxPool Class Reference

# tensorflow::
ops::
MaxPool

`
#include <nn_ops.h>
`


Performs max pooling on the input.

## Summary


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- input: 4-D input to pool over.
- ksize: The size of the window for each dimension of the input tensor.
- strides: The stride of the sliding window for each dimension of the input tensor.
- padding: The type of padding algorithm to use.

<br />


Optional attributes (see
`
https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/max-pool/attrs#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs
`
):

- data_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: \[batch, in_height, in_width, in_channels\]. Alternatively, the format could be "NCHW", the data storage order of: \[batch, in_channels, in_height, in_width\].

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` : The max pooled output tensor.

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/max-pool#classtensorflow_1_1ops_1_1_max_pool_1a85c264b2e8ed1e7031e9e4692ea8af7c (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 input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding) ` ||
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/max-pool#classtensorflow_1_1ops_1_1_max_pool_1acb5b1aa4ace59a30fba3bc4181dbc4ff (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 input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/max-pool/attrs#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs & attrs) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/max-pool#classtensorflow_1_1ops_1_1_max_pool_1aa2739bb33bb12350d02960466baf596e ` | ` 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/max-pool#classtensorflow_1_1ops_1_1_max_pool_1aad19527c00a49d78119e18772098c1b3 ` | ` :: 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/max-pool#classtensorflow_1_1ops_1_1_max_pool_1af4523c29c71806e2dbd3c1137bc875b9 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/max-pool#classtensorflow_1_1ops_1_1_max_pool_1a9a8f1258cb38b51df4ba77452dd41eff () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/max-pool#classtensorflow_1_1ops_1_1_max_pool_1a6ff803d407d19f2e5c2048399a781ee6 () const ` | ` ` |

| ### Public static functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/max-pool#classtensorflow_1_1ops_1_1_max_pool_1a0849cb3a4a5b5191cae18dc8825701ef (StringPiece x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/max-pool/attrs#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/max-pool#classtensorflow_1_1ops_1_1_max_pool_1a030dad5a5f8e36ffad1a8d33db104137 (const gtl::ArraySlice< int > & x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/max-pool/attrs#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs ` |

| ### Structs ||
|---|---|
| [tensorflow:: ops:: MaxPool:: Attrs](https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/max-pool/attrs) | Optional attribute setters for [MaxPool](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/max-pool#classtensorflow_1_1ops_1_1_max_pool) . |

## Public attributes

### operation

```
Operation operation
```

### output

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

## Public functions

### MaxPool

```
 MaxPool(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  const gtl::ArraySlice< int > & ksize,
  const gtl::ArraySlice< int > & strides,
  StringPiece padding
)
```

### MaxPool

```
 MaxPool(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  const gtl::ArraySlice< int > & ksize,
  const gtl::ArraySlice< int > & strides,
  StringPiece padding,
  const MaxPool::Attrs & attrs
)
```

### node

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

### operator::tensorflow::Input

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

### operator::tensorflow::Output

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

## Public static functions

### DataFormat

```
Attrs DataFormat(
  StringPiece x
)
```

### ExplicitPaddings

```
Attrs ExplicitPaddings(
  const gtl::ArraySlice< int > & x
)
```