Find the sum of values in the input.  
More...
|  | 
| AFAPI array | sum (const array &in, const int dim=-1) | 
|  | C++ Interface for sum of elements in an array.  More... 
 | 
|  | 
| AFAPI array | sum (const array &in, const int dim, const double nanval) | 
|  | C++ Interface for sum of elements in an array while replacing nan values.  More... 
 | 
|  | 
| template<typename T > | 
| T | sum (const array &in) | 
|  | C++ Interface for sum of all elements in an array.  More... 
 | 
|  | 
| template<typename T > | 
| T | sum (const array &in, double nanval) | 
|  | C++ Interface for sum of all elements in an array while replacing nan values.  More... 
 | 
|  | 
| AFAPI af_err | af_sum (af_array *out, const af_array in, const int dim) | 
|  | C Interface for sum of elements in an array.  More... 
 | 
|  | 
| AFAPI af_err | af_sum_nan (af_array *out, const af_array in, const int dim, const double nanval) | 
|  | C Interface for sum of elements in an array while replacing nans.  More... 
 | 
|  | 
| AFAPI af_err | af_sum_all (double *real, double *imag, const af_array in) | 
|  | C Interface for sum of all elements in an array.  More... 
 | 
|  | 
| AFAPI af_err | af_sum_nan_all (double *real, double *imag, const af_array in, const double nanval) | 
|  | C Interface for sum of all elements in an array while replacing nans.  More... 
 | 
|  | 
Find the sum of values in the input. 
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. 
C Interface for sum of elements in an array. 
- Parameters
- 
  
    | [out] | out | will contain the sum of all values in inalongdim |  | [in] | in | is the input array |  | [in] | dim | The dimension along which the add operation occurs |  
 
- Returns
- AF_SUCCESS if the execution completes properly 
 
 
C Interface for sum of all elements in an array. 
- Parameters
- 
  
    | [out] | real | will contain the real part of adding all elements in input in |  | [out] | imag | will contain the imaginary part of adding all elements in input in |  | [in] | in | is the input array |  
 
- Returns
- AF_SUCCESS if the execution completes properly
- Note
- imagis always set to 0 when- inis real
 
 
C Interface for sum of elements in an array while replacing nans. 
- Parameters
- 
  
    | [out] | out | will contain the sum of all values in inalongdim |  | [in] | in | is the input array |  | [in] | dim | The dimension along which the add operation occurs |  | [in] | nanval | Replace nans with the value passed to this function |  
 
- Returns
- AF_SUCCESS if the execution completes properly 
 
 
      
        
          | AFAPI af_err af_sum_nan_all | ( | double * | real, | 
        
          |  |  | double * | imag, | 
        
          |  |  | const af_array | in, | 
        
          |  |  | const double | nanval | 
        
          |  | ) |  |  | 
      
 
C Interface for sum of all elements in an array while replacing nans. 
- Parameters
- 
  
    | [out] | real | will contain the real part of adding all elements in input in |  | [out] | imag | will contain the imaginary part of adding all elements in input in |  | [in] | in | is the input array |  | [in] | nanval | is the value which replaces nan |  
 
- Returns
- AF_SUCCESS if the execution completes properly
- Note
- imagis always set to 0 when- inis real
 
 
      
        
          | AFAPI array af::sum | ( | const array & | in, | 
        
          |  |  | const int | dim = -1 | 
        
          |  | ) |  |  | 
      
 
 
      
        
          | AFAPI array af::sum | ( | const array & | in, | 
        
          |  |  | const int | dim, | 
        
          |  |  | const double | nanval | 
        
          |  | ) |  |  | 
      
 
C++ Interface for sum of elements in an array while replacing nan values. 
- Parameters
- 
  
    | [in] | in | is the input array |  | [in] | dim | The dimension along which the add operation occurs |  | [in] | nanval | Replace nans with the value passed to this function |  
 
- Returns
- result of sum all values along dimension dim
 
 
      
        
          | T af::sum | ( | const array & | in | ) |  | 
      
 
C++ Interface for sum of all elements in an array. 
- Parameters
- 
  
  
- Returns
- the sum of all values of in
 
 
      
        
          | T af::sum | ( | const array & | in, | 
        
          |  |  | double | nanval | 
        
          |  | ) |  |  | 
      
 
C++ Interface for sum of all elements in an array while replacing nan values. 
- Parameters
- 
  
    | [in] | in | is the input array |  | [in] | nanval | Replace nans with the value passed to this function |  
 
- Returns
- the sum of all values of in