A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
pad
ArrayFire Functions | ArrayFire Functions by Category » Functions to create and modify Arrays » Functions to create arrays.

## Functions
AFAPI array | pad (const array &in, const dim4 &beginPadding, const dim4 &endPadding, const borderType padFillType)
| C++ Interface to pad an array.
AFAPI af_err | af_pad (af_array *out, const af_array in, const unsigned begin_ndims, const dim_t *const begin_dims, const unsigned end_ndims, const dim_t *const end_dims, const af_border_type pad_fill_type)
| C Interface to pad an array.

## Detailed Description

Pad an array.

Pad the input array using a constant or values from input along the border.

## Function Documentation

## ◆ af_pad()

AFAPI af_err af_pad | ( | af_array * | out,
|  | const af_array | in,
|  | const unsigned | begin_ndims,
|  | const dim_t *const | begin_dims,
|  | const unsigned | end_ndims,
|  | const dim_t *const | end_dims,
|  | const af_border_type | pad_fill_type )

C Interface to pad an array.

Parameters

  [out] | out | padded array
  [in] | in | input array
  [in] | begin_ndims | number of dimensions for start padding
  [in] | begin_dims | number of elements to be padded at the start of each dimension
  [in] | end_ndims | number of dimensions for end padding
  [in] | end_dims | number of elements to be padded at the end of each dimension
  [in] | pad_fill_type | values to fill into the padded region

Returns
  AF_SUCCESS, if function returns successfully, else an af_err code is given

## ◆ pad()

AFAPI array pad | ( | const array & | in,
|  | const dim4 & | beginPadding,
|  | const dim4 & | endPadding,
|  | const borderType | padFillType )

C++ Interface to pad an array.

Parameters

  [in] | in | input array
  [in] | beginPadding | number of elements to be padded at the start of each dimension
  [in] | endPadding | number of elements to be padded at the end of each dimension
  [in] | padFillType | values to fill into the padded region

Returns
  padded array