Skip to content

Commit 846c60c

Browse files
committed
Auto-generated commit
1 parent 47a6135 commit 846c60c

13 files changed

Lines changed: 346 additions & 242 deletions

File tree

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,40 @@
22

33
> Package changelog.
44
5+
<section class="release" id="unreleased">
6+
7+
## Unreleased (2026-03-24)
8+
9+
<section class="commits">
10+
11+
### Commits
12+
13+
<details>
14+
15+
- [`f44463a`](https://github.com/stdlib-js/stdlib/commit/f44463a257a9c70c3b0baa84168bcb1f10cd438e) - **docs:** update examples and docs to accommodate dtype instances _(by Athan Reines)_
16+
17+
</details>
18+
19+
</section>
20+
21+
<!-- /.commits -->
22+
23+
<section class="contributors">
24+
25+
### Contributors
26+
27+
A total of 1 person contributed to this release. Thank you to this contributor:
28+
29+
- Athan Reines
30+
31+
</section>
32+
33+
<!-- /.contributors -->
34+
35+
</section>
36+
37+
<!-- /.release -->
38+
539
<section class="release" id="v0.3.1">
640

741
## 0.3.1 (2026-02-08)

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,16 @@ var zerosLike = require( '@stdlib/ndarray-base-zeros-like' );
7878
Creates a zero-filled ndarray having the same shape and [data type][@stdlib/ndarray/dtypes] as a provided ndarray.
7979

8080
```javascript
81+
var getShape = require( '@stdlib/ndarray-shape' );
8182
var zeros = require( '@stdlib/ndarray-base-zeros' );
8283

8384
var x = zeros( 'float64', [ 2, 2 ], 'row-major' );
84-
// returns <ndarray>
85+
// returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
8586

8687
var y = zerosLike( x );
87-
// returns <ndarray>
88+
// returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
8889

89-
var sh = y.shape;
90+
var sh = getShape( y );
9091
// returns [ 2, 2 ]
9192
```
9293

@@ -117,19 +118,18 @@ var sh = y.shape;
117118
```javascript
118119
var dtypes = require( '@stdlib/ndarray-dtypes' );
119120
var zeros = require( '@stdlib/ndarray-base-zeros' );
121+
var ndarray2array = require( '@stdlib/ndarray-to-array' );
120122
var zerosLike = require( '@stdlib/ndarray-base-zeros-like' );
121123

122124
// Get a list of data types:
123-
var dt = dtypes( 'numeric' );
125+
var dt = dtypes( 'integer_and_generic' );
124126

125127
// Generate zero-filled arrays...
126128
var x;
127-
var y;
128129
var i;
129130
for ( i = 0; i < dt.length; i++ ) {
130-
x = zeros( dt[ i ], [ 2, 2 ], 'row-major' );
131-
y = zerosLike( x );
132-
console.log( y.data );
131+
x = zerosLike( zeros( dt[ i ], [ 2, 2 ], 'row-major' ) );
132+
console.log( ndarray2array( x ) );
133133
}
134134
```
135135

dist/index.js

Lines changed: 18 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/repl.txt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,9 @@
2121
Examples
2222
--------
2323
> var x = {{alias:@stdlib/ndarray/base/zeros}}( 'float64', [ 2, 2 ], 'row-major' )
24-
<ndarray>
25-
> var sh = x.shape
26-
[ 2, 2 ]
27-
> var dt = x.dtype
28-
'float64'
24+
<ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
2925
> var y = {{alias}}( x )
30-
<ndarray>
31-
> sh = y.shape
32-
[ 2, 2 ]
33-
> dt = y.dtype
34-
'float64'
26+
<ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
3527

3628
See Also
3729
--------

0 commit comments

Comments
 (0)