# tensorflow::ops::PadV2 Class Reference

# tensorflow::
ops::
PadV2

`
#include <array_ops.h>
`


Pads a tensor.

## Summary


This operation pads
`
input
`
according to the
`
paddings
`
and
`
constant_values
`
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 padding values to add before the contents of
`
input
`
in that dimension, and
`
paddings[D, 1]
`
indicates how many padding values to add after the contents of
`
input
`
in that dimension.
`
constant_values
`
is a scalar tensor of the same type as
`
input
`
that indicates the value to use for padding
`
input
`
.


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]]
# 'constant_values' is 0
# 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.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object

<br />


Returns:

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

<br />

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

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/pad-v2#classtensorflow_1_1ops_1_1_pad_v2_1aa6b1cf71582c8eb44a33bac7b2750a55 ` | ` 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/pad-v2#classtensorflow_1_1ops_1_1_pad_v2_1ad73c63310fcef6d2993c1a43c93aa7a1 ` | ` :: 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/pad-v2#classtensorflow_1_1ops_1_1_pad_v2_1a4f62d5b59022fec3a068bd2196a98891 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/pad-v2#classtensorflow_1_1ops_1_1_pad_v2_1a74d06bca0cc72234b6a1578639fca7f5 () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/pad-v2#classtensorflow_1_1ops_1_1_pad_v2_1ad0329a090a7e956fcd77489c7d27edc4 () const ` | ` ` |

## Public attributes

### operation

```
Operation operation
```

### output

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

## Public functions

### PadV2

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

### node

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

### operator::tensorflow::Input

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

### operator::tensorflow::Output

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