Perform exclusive sum along specified dimension. More...

Functions

AFAPI array accum (const array &in, const int dim=0)
 C++ Interface exclusive sum (cumulative sum) of an array. More...
 
AFAPI af_err af_accum (af_array *out, const af_array in, const int dim)
 C Interface exclusive sum (cumulative sum) of an array. More...
 

Detailed Description

Perform exclusive sum along specified dimension.

This table defines the return value types for the corresponding input types

Input Type Output Type
f32, f64, c32, c64 same as input
s32, u32, s64, u64 same as input
s16 s32
u16, u8, b8 u32

This function performs the operation across all batches present in the input simultaneously.

Function Documentation

AFAPI array af::accum ( const array in,
const int  dim = 0 
)

C++ Interface exclusive sum (cumulative sum) of an array.

Parameters
[in]inis the input array
[in]dimThe dimension along which exclusive sum is performed
Returns
the output containing exclusive sums of the input
Examples:
image_processing/binary_thresholding.cpp.
AFAPI af_err af_accum ( af_array out,
const af_array  in,
const int  dim 
)

C Interface exclusive sum (cumulative sum) of an array.

Parameters
[out]outwill contain exclusive sums of the input
[in]inis the input array
[in]dimThe dimension along which exclusive sum is performed
Returns
AF_SUCCESS if the execution completes properly