# tensorflow::ops::Pad Class Reference

# tensorflow::
ops::
Pad

`
#include <array_ops.h>
`


Pads a tensor with zeros.

## Summary


This operation pads a
`
input
`
with zeros according to the
`
paddings
`
you specify.
`
paddings
`
is an integer tensor with shape
`
[Dn, 2]
`
, where n is the rank of
`
input
`
. For each dimension D of
`
input
`
,
`
paddings[D, 0]
`
indicates how many zeros to add before the contents of
`
input
`
in that dimension, and
`
paddings[D, 1]
`
indicates how many zeros to add after the contents of
`
input
`
in that dimension.


The padded size of each dimension D of the output is:


`
paddings(D, 0) + input.dim_size(D) + paddings(D, 1)
`


For example:


```
# 't' is [[1, 1], [2, 2]]
# 'paddings' is [[1, 1], [2, 2]]
# rank of 't' is 2
pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
                      [0, 0, 1, 1, 0, 0]
                      [0, 0, 2, 2, 0, 0]
                      [0, 0, 0, 0, 0, 0]]
```

<br />


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object

<br />


Returns:

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

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/pad#classtensorflow_1_1ops_1_1_pad_1a85413c81814471dc1ba383fffd013f80 (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, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input paddings) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/pad#classtensorflow_1_1ops_1_1_pad_1a563b99bce289e4fa9fff7224401df773 ` | ` 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/pad#classtensorflow_1_1ops_1_1_pad_1aa9ec34eb45ae5c727d6bba3e8b51be74 ` | ` :: 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/pad#classtensorflow_1_1ops_1_1_pad_1a56e85f7a36d0008faa2e054812438b98 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/pad#classtensorflow_1_1ops_1_1_pad_1a800a33c0560ed61b5f202d6a5aaf4ca9 () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/pad#classtensorflow_1_1ops_1_1_pad_1a177bc15a4ed8369a6438d47130f9ac27 () const ` | ` ` |

## Public attributes

### operation

```
Operation operation
```

### output

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

## Public functions

### Pad

```
 Pad(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input paddings
)
```

### node

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

### operator::tensorflow::Input

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

### operator::tensorflow::Output

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