Generate an identity matrix.  
More...
|  | 
| array | identity (const dim4 &dims, const dtype ty=f32) | 
|  | C++ Interface to generate an identity array. 
 | 
|  | 
| array | identity (const dim_t d0, const dtype ty=f32) | 
|  | C++ Interface to generate a 1-D identity array. 
 | 
|  | 
| array | identity (const dim_t d0, const dim_t d1, const dtype ty=f32) | 
|  | C++ Interface to generate a 2-D identity array. 
 | 
|  | 
| array | identity (const dim_t d0, const dim_t d1, const dim_t d2, const dtype ty=f32) | 
|  | C++ Interface to generate a 3-D identity array. 
 | 
|  | 
| array | identity (const dim_t d0, const dim_t d1, const dim_t d2, const dim_t d3, const dtype ty=f32) | 
|  | C++ Interface to generate a 4-D identity array. 
 | 
|  | 
| af_err | af_identity (af_array *out, const unsigned ndims, const dim_t *const dims, const af_dtype type) | 
|  | C Interface to generate an identity array. 
 | 
|  | 
Generate an identity matrix. 
array a = identity(5, 3);
 
◆ af_identity()
C Interface to generate an identity array. 
- Parameters
- 
  
    | [out] | out | identity array |  | [in] | ndims | number of dimensions |  | [in] | dims | size |  | [in] | type | type |  
 
- Returns
- AF_SUCCESS, if function returns successfully, else an af_err code is given 
 
 
◆ identity() [1/5]
C++ Interface to generate an identity array. 
- Parameters
- 
  
  
- Returns
- identity array 
 
 
◆ identity() [2/5]
C++ Interface to generate a 4-D identity array. 
- Parameters
- 
  
    | [in] | d0 | size of the first dimension |  | [in] | d1 | size of the second dimension |  | [in] | d2 | size of the third dimension |  | [in] | d3 | size of the fourth dimension |  | [in] | ty | type |  
 
- Returns
- identity array 
 
 
◆ identity() [3/5]
C++ Interface to generate a 3-D identity array. 
- Parameters
- 
  
    | [in] | d0 | size of the first dimension |  | [in] | d1 | size of the second dimension |  | [in] | d2 | size of the third dimension |  | [in] | ty | type |  
 
- Returns
- identity array 
 
 
◆ identity() [4/5]
C++ Interface to generate a 2-D identity array. 
- Parameters
- 
  
    | [in] | d0 | size of the first dimension |  | [in] | d1 | size of the second dimension |  | [in] | ty | type |  
 
- Returns
- identity array 
 
 
◆ identity() [5/5]
C++ Interface to generate a 1-D identity array. 
- Parameters
- 
  
    | [in] | d0 | size of the first dimension |  | [in] | ty | type |  
 
- Returns
- identity array