- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
moddims
Complete List of ArrayFire Functions ArrayFire Functions by Category » Functions to create and modify Arrays » | Move and Reorder array content

Modify the input dimensions without changing the data order. More...

## Functions
AFAPI array | moddims (const array &in, const unsigned ndims, const dim_t *const dims)
AFAPI array | moddims (const array &in, const dim4 &dims)
AFAPI array | moddims (const array &in, const dim_t d0, const dim_t d1=1, const dim_t d2=1, const dim_t d3=1)
AFAPI af_err | af_moddims (af_array *out, const af_array in, const unsigned ndims, const dim_t *const dims)

## Detailed Description

Modify the input dimensions without changing the data order.

Simply modifies the metadata. This is a noop.

## Function Documentation

AFAPI af_err af_moddims | ( | af_array * | out,
|  | const af_array | in,
|  | const unsigned | ndims,
|  | const dim_t *const | dims
| ) |  |

Parameters

  [out] | out | is the modded array
  [in] | in | is the input array
  [in] | ndims | is the number of dimensions
  [in] | dims | is the array containing the new dimensions

Examples:
  blas.cpp.

AFAPI array af::moddims | ( | const array & | in,
|  | const unsigned | ndims,
|  | const dim_t *const | dims
| ) |  |

Parameters

  [in] | in | is the input array
  [in] | ndims | is the number of dimensions
  [in] | dims | is the array containing the new dimensions

Returns
  the modded output

Examples:
  bagging.cpp, blas.cpp, brain_segmentation.cpp, deep_belief_net.cpp, fft.cpp, filters.cpp, kmeans.cpp, knn.cpp, logistic_regression.cpp, naive_bayes.cpp, neural_network.cpp, perceptron.cpp, rbm.cpp, softmax_regression.cpp, and vectorize.cpp.

AFAPI array af::moddims | ( | const array & | in,
|  | const dim4 & | dims
| ) |  |

Parameters

  [in] | in | is the input array
  [in] | dims | is the new dimensions

Returns
  the modded output

AFAPI array af::moddims | ( | const array & | in,
|  | const dim_t | d0,
|  | const dim_t | d1 = `1`,
|  | const dim_t | d2 = `1`,
|  | const dim_t | d3 = `1`
| ) |  |

Parameters

  [in] | in | is the input array
  [in] | d0 | specifies the new size of the first dimension
  [in] | d1 | specifies the new size of the second dimension
  [in] | d2 | specifies the new size of the third dimension
  [in] | d3 | specifies the new size of the fourth dimension

Returns
  the modded array