You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/ndarray/flatten/README.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,8 @@ The function accepts the following options:
72
72
73
73
-**depth**: maximum number of input [ndarray][@stdlib/ndarray/ctor] dimensions to flatten.
74
74
75
+
-**dtype**: output ndarray [data type][@stdlib/ndarray/dtypes]. If not specified, the output ndarray [data type][@stdlib/ndarray/dtypes] is inferred from the input [ndarray][@stdlib/ndarray/ctor].
76
+
75
77
By default, the function flattens all dimensions of the input [ndarray][@stdlib/ndarray/ctor]. To flatten to a desired depth, specify the `depth` option.
76
78
77
79
```javascript
@@ -108,6 +110,28 @@ var arr = ndarray2array( y );
108
110
// returns [ 1.0, 3.0, 5.0, 2.0, 4.0, 6.0 ]
109
111
```
110
112
113
+
By default, the output ndarray [data type][@stdlib/ndarray/dtypes] is inferred from the input [ndarray][@stdlib/ndarray/ctor]. To return an ndarray with a different [data type][@stdlib/ndarray/dtypes], specify the `dtype` option.
114
+
115
+
```javascript
116
+
var array =require( '@stdlib/ndarray/array' );
117
+
var dtype =require( '@stdlib/ndarray/dtype' );
118
+
var ndarray2array =require( '@stdlib/ndarray/to-array' );
0 commit comments