Generate a tiled array by repeating an array's contents along a specified dimension. More...
Functions | |
AFAPI array | tile (const array &in, const unsigned x, const unsigned y=1, const unsigned z=1, const unsigned w=1) |
C++ Interface to generate a tiled array. More... | |
AFAPI array | tile (const array &in, const dim4 &dims) |
C++ Interface to generate a tiled array. More... | |
AFAPI af_err | af_tile (af_array *out, const af_array in, const unsigned x, const unsigned y, const unsigned z, const unsigned w) |
C Interface to generate a tiled array. More... | |
Generate a tiled array by repeating an array's contents along a specified dimension.
Creates copies of the input array and concatenates them with each other, such that the output array will have as many copies of the input array as the user specifies along each dimension. In this sense, the output array is a set of "tiles" where each copy of the input array, including the original, is a "tile".
Given below are some examples. The input array looks like this:
Here, the input array is tiled along the first dimenson, 2 times:
Here, the input is tiled along the second dimension, 3 times:
Lastly, one can also tile along multiple dimensions simultaneously. Here, the input is tiled 2 times in the first dimension and 3 times in the second dimension:
AFAPI af_err af_tile | ( | af_array * | out, |
const af_array | in, | ||
const unsigned | x, | ||
const unsigned | y, | ||
const unsigned | z, | ||
const unsigned | w | ||
) |
C Interface to generate a tiled array.
Note, x
, y
, z
, and w
include the original in the count.
[out] | out | tiled array |
[in] | in | input array |
[in] | x | number of tiles along the first dimension |
[in] | y | number of tiles along the second dimension |
[in] | z | number of tiles along the third dimension |
[in] | w | number of tiles along the fourth dimension |
C++ Interface to generate a tiled array.
Each component of dims
includes the original in the count. Thus, if no duplicates are needed in a certain dimension, it is left as 1, the default value for just one copy.
[in] | in | input array |
[in] | dims | number of times in is copied along each dimension |
AFAPI array tile | ( | const array & | in, |
const unsigned | x, | ||
const unsigned | y = 1 , |
||
const unsigned | z = 1 , |
||
const unsigned | w = 1 |
||
) |
C++ Interface to generate a tiled array.
Note, x
, y
, z
, and w
include the original in the count.
[in] | in | input array |
[in] | x | number tiles along the first dimension |
[in] | y | number tiles along the second dimension |
[in] | z | number tiles along the third dimension |
[in] | w | number tiles along the fourth dimension |