# tensorflow::ops::AvgPool Class Reference

# tensorflow::
ops::
AvgPool

`
#include <nn_ops.h>
`


Performs average pooling on the input.

## Summary


Each entry in
`
output
`
is the mean of the corresponding size
`
ksize
`
window in
`
value
`
.


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- value: 4-D with shape `
  [batch, height, width, channels]
  ` .
- ksize: The size of the sliding window for each dimension of `
  value
  ` .
- strides: The stride of the sliding window for each dimension of `
  value
  ` .
- 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/avg-pool/attrs#structtensorflow_1_1ops_1_1_avg_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 average pooled output tensor.

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/avg-pool#classtensorflow_1_1ops_1_1_avg_pool_1a58bd5cc7bc50a385d9b5407b567887f3 (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 value, 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/avg-pool#classtensorflow_1_1ops_1_1_avg_pool_1a0f24ed27c87f4865fcaa1b312d36051e (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 value, 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/avg-pool/attrs#structtensorflow_1_1ops_1_1_avg_pool_1_1_attrs & attrs) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/avg-pool#classtensorflow_1_1ops_1_1_avg_pool_1a9ba893843bb88eb584fe939ccc894c47 ` | ` 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/avg-pool#classtensorflow_1_1ops_1_1_avg_pool_1a7450e2619257f7964d4f2cd80fe4ef06 ` | ` :: 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/avg-pool#classtensorflow_1_1ops_1_1_avg_pool_1a8ec01e53d8d2acab543c9012e451de71 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/avg-pool#classtensorflow_1_1ops_1_1_avg_pool_1a4e2e1ea74f43b355dca513d2bfe8d0a0 () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/avg-pool#classtensorflow_1_1ops_1_1_avg_pool_1ad407c5a3d99897fdc14d133bac7172d0 () const ` | ` ` |

| ### Public static functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/avg-pool#classtensorflow_1_1ops_1_1_avg_pool_1a4295525a4e3759a16de6a93c7f421b8d (StringPiece x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/avg-pool/attrs#structtensorflow_1_1ops_1_1_avg_pool_1_1_attrs ` |

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

## Public attributes

### operation

```
Operation operation
```

### output

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

## Public functions

### AvgPool

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

### AvgPool

```
 AvgPool(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input value,
  const gtl::ArraySlice< int > & ksize,
  const gtl::ArraySlice< int > & strides,
  StringPiece padding,
  const AvgPool::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
)
```