repl.txt (914B)
1 2 {{alias}}( buffer, shape, strides, offset, order ) 3 Converts an ndarray buffer to a generic array. 4 5 Parameters 6 ---------- 7 buffer: ArrayLike|TypedArray|Buffer 8 Array buffer. 9 10 shape: ArrayLike 11 Array shape. 12 13 strides: ArrayLike 14 Stride array. 15 16 offset: integer 17 Location of the first indexed value based on the stride array. 18 19 order: string 20 Specifies whether an array is row-major (C-style) or column-major 21 (Fortran-style). 22 23 Returns 24 ------- 25 out: Array|Array<Array> 26 Generic array (which may include nested arrays). 27 28 Examples 29 -------- 30 > var b = [ 1, 2, 3, 4 ]; 31 > var d = [ 2, 2 ]; 32 > var s = [ 2, 1 ]; 33 > var o = 0; 34 > var out = {{alias}}( b, d, s, o, 'row-major' ) 35 [ [ 1, 2 ], [ 3, 4 ] ] 36 > out = {{alias}}( b, d, s, o, 'column-major' ) 37 [ [ 1, 3 ], [ 2, 4 ] ] 38 39 See Also 40 -------- 41