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: range/README.md
+10-39Lines changed: 10 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,10 +48,7 @@ var array = require( '@stdlib/ndarray/array' );
48
48
var x =array( [ -1.0, 2.0, -3.0 ] );
49
49
50
50
var y =range( x );
51
-
// returns <ndarray>
52
-
53
-
var v =y.get();
54
-
// returns 5.0
51
+
// returns <ndarray>[ 5.0 ]
55
52
```
56
53
57
54
The function has the following parameters:
@@ -68,81 +65,58 @@ The function accepts the following options:
68
65
By default, the function performs a reduction over all elements in a provided input [ndarray][@stdlib/ndarray/ctor]. To perform a reduction over specific dimensions, provide a `dims` option.
69
66
70
67
```javascript
71
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
By default, the function excludes reduced dimensions from the output [ndarray][@stdlib/ndarray/ctor]. To include the reduced dimensions as singleton dimensions, set the `keepdims` option to `true`.
107
93
108
94
```javascript
109
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a [data type][@stdlib/ndarray/dtypes] determined by the function's output data type [policy][@stdlib/ndarray/output-dtype-policies]. To override the default behavior, set the `dtype` option.
@@ -176,10 +150,7 @@ var x = array( [ -1.0, 2.0, -3.0 ] );
Copy file name to clipboardExpand all lines: range/docs/types/index.d.ts
+4-16Lines changed: 4 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -75,10 +75,7 @@ interface Unary {
75
75
* var x = array( [ -1.0, 2.0, -3.0 ] );
76
76
*
77
77
* var y = range( x );
78
-
* // returns <ndarray>
79
-
*
80
-
* var v = y.get();
81
-
* // returns 5.0
78
+
* // returns <ndarray>[ 5.0 ]
82
79
*/
83
80
<T=unknown,U=unknown>(x: InputArray<T>,options?: Options): OutputArray<U>;// NOTE: we lose type specificity here, but retaining specificity would likely be difficult and/or tedious to completely enumerate, as the output ndarray data type is dependent on how `x` interacts with output data type policy and whether that policy has been overridden by `options.dtype`.
0 commit comments